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 17 matching lines...) Expand all Loading... |
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/Noncopyable.h" | 31 #include "wtf/Noncopyable.h" |
32 #include "wtf/PassOwnPtr.h" | 32 #include "wtf/PassOwnPtr.h" |
33 | 33 |
34 class SkCanvas; | 34 class SkCanvas; |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class DisplayItemList; | |
39 class GraphicsContext; | 38 class GraphicsContext; |
40 class IntRect; | 39 class IntRect; |
| 40 class PaintController; |
41 | 41 |
42 class PLATFORM_EXPORT GraphicsContextPainter { | 42 class PLATFORM_EXPORT GraphicsContextPainter { |
43 public: | 43 public: |
44 virtual void paint(GraphicsContext&, const IntRect& clip) = 0; | 44 virtual void paint(GraphicsContext&, const IntRect& clip) = 0; |
45 // Paints the content if required, either because the content changed or its
interest rect has too much unpainted area. | 45 // Paints the content if required, either because the content changed or its
interest rect has too much unpainted area. |
46 virtual void paintIfNeeded(GraphicsContext&) = 0; | 46 virtual void paintIfNeeded(GraphicsContext&) = 0; |
47 virtual DisplayItemList* displayItemList() = 0; | 47 virtual PaintController* paintController() = 0; |
48 | 48 |
49 protected: | 49 protected: |
50 virtual ~GraphicsContextPainter() { } | 50 virtual ~GraphicsContextPainter() { } |
51 }; | 51 }; |
52 | 52 |
53 class PLATFORM_EXPORT ContentLayerDelegate : public WebContentLayerClient { | 53 class PLATFORM_EXPORT ContentLayerDelegate : public WebContentLayerClient { |
54 WTF_MAKE_NONCOPYABLE(ContentLayerDelegate); | 54 WTF_MAKE_NONCOPYABLE(ContentLayerDelegate); |
55 | 55 |
56 public: | 56 public: |
57 explicit ContentLayerDelegate(GraphicsContextPainter*); | 57 explicit ContentLayerDelegate(GraphicsContextPainter*); |
58 ~ContentLayerDelegate() override; | 58 ~ContentLayerDelegate() override; |
59 | 59 |
60 // WebContentLayerClient implementation. | 60 // WebContentLayerClient implementation. |
61 void paintContents(SkCanvas*, const WebRect& clip, WebContentLayerClient::Pa
intingControlSetting = PaintDefaultBehavior) override; | 61 void paintContents(SkCanvas*, const WebRect& clip, WebContentLayerClient::Pa
intingControlSetting = PaintDefaultBehavior) override; |
62 void paintContents(WebDisplayItemList*, const WebRect& clip, WebContentLayer
Client::PaintingControlSetting = PaintDefaultBehavior) override; | 62 void paintContents(WebDisplayItemList*, const WebRect& clip, WebContentLayer
Client::PaintingControlSetting = PaintDefaultBehavior) override; |
63 size_t approximateUnsharedMemoryUsage() const override; | 63 size_t approximateUnsharedMemoryUsage() const override; |
64 | 64 |
65 private: | 65 private: |
66 GraphicsContextPainter* m_painter; | 66 GraphicsContextPainter* m_painter; |
67 }; | 67 }; |
68 | 68 |
69 } // namespace blink | 69 } // namespace blink |
70 | 70 |
71 #endif // ContentLayerDelegate_h | 71 #endif // ContentLayerDelegate_h |
OLD | NEW |