OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PaintArtifactCompositor_h | 5 #ifndef PaintArtifactCompositor_h |
6 #define PaintArtifactCompositor_h | 6 #define PaintArtifactCompositor_h |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 bool hasTrackedRasterInvalidations() const; | 79 bool hasTrackedRasterInvalidations() const; |
80 | 80 |
81 std::unique_ptr<JSONObject> layersAsJSON(LayerTreeFlags) const; | 81 std::unique_ptr<JSONObject> layersAsJSON(LayerTreeFlags) const; |
82 | 82 |
83 private: | 83 private: |
84 PaintArtifactCompositor(); | 84 PaintArtifactCompositor(); |
85 | 85 |
86 class ContentLayerClientImpl; | 86 class ContentLayerClientImpl; |
87 | 87 |
88 // Builds a leaf layer that represents a single paint chunk. | 88 // Builds a leaf layer that represents a single paint chunk. |
89 // Note: cc::Layer API assumes the layer bounds to start at (0, 0) but the bou
nding box of | 89 // Note: cc::Layer API assumes the layer bounds start at (0, 0), but the |
90 // a paint chunk does not necessarily start at (0, 0) and could even be negati
ve. Internally | 90 // bounding box of a paint chunk does not necessarily start at (0, 0) (and |
91 // the generated layer translates the paint chunk to align the bounding box to
(0, 0) and | 91 // could even be negative). Internally the generated layer translates the |
92 // return the actual origin of the paint chunk in output parameter layerOffset
. | 92 // paint chunk to align the bounding box to (0, 0) and return the actual |
| 93 // origin of the paint chunk in the |layerOffset| outparam. |
93 scoped_refptr<cc::Layer> layerForPaintChunk( | 94 scoped_refptr<cc::Layer> layerForPaintChunk( |
94 const PaintArtifact&, | 95 const PaintArtifact&, |
95 const PaintChunk&, | 96 const PaintChunk&, |
96 gfx::Vector2dF& layerOffset, | 97 gfx::Vector2dF& layerOffset, |
97 Vector<std::unique_ptr<ContentLayerClientImpl>>& newContentLayerClients, | 98 Vector<std::unique_ptr<ContentLayerClientImpl>>& newContentLayerClients, |
98 RasterInvalidationTracking*); | 99 RasterInvalidationTracking*); |
99 | 100 |
100 // Finds a client among the current vector of clients that matches the paint c
hunk's id, | 101 // Finds a client among the current vector of clients that matches the paint |
101 // or otherwise allocates a new one. | 102 // chunk's id, or otherwise allocates a new one. |
102 std::unique_ptr<ContentLayerClientImpl> clientForPaintChunk( | 103 std::unique_ptr<ContentLayerClientImpl> clientForPaintChunk( |
103 const PaintChunk&, | 104 const PaintChunk&, |
104 const PaintArtifact&); | 105 const PaintArtifact&); |
105 | 106 |
106 scoped_refptr<cc::Layer> m_rootLayer; | 107 scoped_refptr<cc::Layer> m_rootLayer; |
107 std::unique_ptr<WebLayer> m_webLayer; | 108 std::unique_ptr<WebLayer> m_webLayer; |
108 Vector<std::unique_ptr<ContentLayerClientImpl>> m_contentLayerClients; | 109 Vector<std::unique_ptr<ContentLayerClientImpl>> m_contentLayerClients; |
109 | 110 |
110 bool m_extraDataForTestingEnabled = false; | 111 bool m_extraDataForTestingEnabled = false; |
111 std::unique_ptr<ExtraDataForTesting> m_extraDataForTesting; | 112 std::unique_ptr<ExtraDataForTesting> m_extraDataForTesting; |
112 friend class StubChromeClientForSPv2; | 113 friend class StubChromeClientForSPv2; |
113 | 114 |
114 bool m_isTrackingRasterInvalidations; | 115 bool m_isTrackingRasterInvalidations; |
115 }; | 116 }; |
116 | 117 |
117 } // namespace blink | 118 } // namespace blink |
118 | 119 |
119 #endif // PaintArtifactCompositor_h | 120 #endif // PaintArtifactCompositor_h |
OLD | NEW |