| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef ContentLayerDelegate_h | 25 #ifndef ContentLayerDelegate_h |
| 26 #define ContentLayerDelegate_h | 26 #define ContentLayerDelegate_h |
| 27 | 27 |
| 28 #include "platform/PlatformExport.h" | 28 #include "platform/PlatformExport.h" |
| 29 #include "platform/geometry/IntSize.h" | 29 #include "platform/geometry/IntSize.h" |
| 30 #include "public/platform/WebContentLayerClient.h" | 30 #include "public/platform/WebContentLayerClient.h" |
| 31 #include "wtf/Allocator.h" |
| 31 #include "wtf/Noncopyable.h" | 32 #include "wtf/Noncopyable.h" |
| 32 #include "wtf/PassOwnPtr.h" | 33 #include "wtf/PassOwnPtr.h" |
| 33 | 34 |
| 34 class SkCanvas; | 35 class SkCanvas; |
| 35 | 36 |
| 36 namespace gfx { | 37 namespace gfx { |
| 37 class Rect; | 38 class Rect; |
| 38 } | 39 } |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class GraphicsContext; | 43 class GraphicsContext; |
| 43 class IntRect; | 44 class IntRect; |
| 44 class PaintController; | 45 class PaintController; |
| 45 | 46 |
| 46 class PLATFORM_EXPORT GraphicsContextPainter { | 47 class PLATFORM_EXPORT GraphicsContextPainter { |
| 47 public: | 48 public: |
| 48 virtual IntRect interestRect() = 0; | 49 virtual IntRect interestRect() = 0; |
| 49 virtual void paint(GraphicsContext&, const IntRect* interestRect) = 0; | 50 virtual void paint(GraphicsContext&, const IntRect* interestRect) = 0; |
| 50 virtual PaintController* paintController() = 0; | 51 virtual PaintController* paintController() = 0; |
| 51 | 52 |
| 52 protected: | 53 protected: |
| 53 virtual ~GraphicsContextPainter() { } | 54 virtual ~GraphicsContextPainter() { } |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 class PLATFORM_EXPORT ContentLayerDelegate : public WebContentLayerClient { | 57 class PLATFORM_EXPORT ContentLayerDelegate : public WebContentLayerClient { |
| 57 WTF_MAKE_NONCOPYABLE(ContentLayerDelegate); | 58 WTF_MAKE_NONCOPYABLE(ContentLayerDelegate); |
| 58 | 59 USING_FAST_MALLOC(ContentLayerDelegate); |
| 59 public: | 60 public: |
| 60 explicit ContentLayerDelegate(GraphicsContextPainter*); | 61 explicit ContentLayerDelegate(GraphicsContextPainter*); |
| 61 ~ContentLayerDelegate() override; | 62 ~ContentLayerDelegate() override; |
| 62 | 63 |
| 63 gfx::Rect paintableRegion() override; | 64 gfx::Rect paintableRegion() override; |
| 64 | 65 |
| 65 // WebContentLayerClient implementation. | 66 // WebContentLayerClient implementation. |
| 66 void paintContents(WebDisplayItemList*, WebContentLayerClient::PaintingContr
olSetting = PaintDefaultBehavior) override; | 67 void paintContents(WebDisplayItemList*, WebContentLayerClient::PaintingContr
olSetting = PaintDefaultBehavior) override; |
| 67 size_t approximateUnsharedMemoryUsage() const override; | 68 size_t approximateUnsharedMemoryUsage() const override; |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 GraphicsContextPainter* m_painter; | 71 GraphicsContextPainter* m_painter; |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 } // namespace blink | 74 } // namespace blink |
| 74 | 75 |
| 75 #endif // ContentLayerDelegate_h | 76 #endif // ContentLayerDelegate_h |
| OLD | NEW |