| 1 | /* |
| 2 | Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) |
| 3 | |
| 4 | This library is free software; you can redistribute it and/or |
| 5 | modify it under the terms of the GNU Library General Public |
| 6 | License as published by the Free Software Foundation; either |
| 7 | version 2 of the License, or (at your option) any later version. |
| 8 | |
| 9 | This library is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | Library General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Library General Public License |
| 15 | along with this library; see the file COPYING.LIB. If not, write to |
| 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #if USE(TEXTURE_MAPPER) |
| 23 | |
| 24 | #include "TextureMapper.h" |
| 25 | #include "TransformationMatrix.h" |
| 26 | |
| 27 | namespace WebCore { |
| 28 | |
| 29 | class TextureMapperPlatformLayer { |
| 30 | public: |
| 31 | class Client { |
| 32 | public: |
| 33 | virtual void platformLayerWillBeDestroyed() = 0; |
| 34 | virtual void setPlatformLayerNeedsDisplay() = 0; |
| 35 | }; |
| 36 | |
| 37 | TextureMapperPlatformLayer() = default; |
| 38 | virtual ~TextureMapperPlatformLayer() = default; |
| 39 | |
| 40 | virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) = 0; |
| 41 | |
| 42 | virtual void drawBorder(TextureMapper& textureMapper, const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform) |
| 43 | { |
| 44 | textureMapper.drawBorder(color, borderWidth, targetRect, transform); |
| 45 | } |
| 46 | |
| 47 | void setClient(TextureMapperPlatformLayer::Client* client) { m_client = client; } |
| 48 | |
| 49 | protected: |
| 50 | TextureMapperPlatformLayer::Client* client() { return m_client; } |
| 51 | |
| 52 | private: |
| 53 | TextureMapperPlatformLayer::Client* m_client { nullptr }; |
| 54 | }; |
| 55 | |
| 56 | } // namespace WebCore |
| 57 | |
| 58 | #endif // USE(TEXTURE_MAPPER) |
| 59 | |