Chromium Code Reviews| 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 30 matching lines...) Expand all Loading... | |
| 41 WTF_MAKE_NONCOPYABLE(PaintArtifactCompositor); | 41 WTF_MAKE_NONCOPYABLE(PaintArtifactCompositor); |
| 42 | 42 |
| 43 public: | 43 public: |
| 44 ~PaintArtifactCompositor(); | 44 ~PaintArtifactCompositor(); |
| 45 | 45 |
| 46 static std::unique_ptr<PaintArtifactCompositor> create() { | 46 static std::unique_ptr<PaintArtifactCompositor> create() { |
| 47 return WTF::wrapUnique(new PaintArtifactCompositor()); | 47 return WTF::wrapUnique(new PaintArtifactCompositor()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Updates the layer tree to match the provided paint artifact. | 50 // Updates the layer tree to match the provided paint artifact. |
| 51 // If |storeDebugInfo| is true, stores detailed debugging information in | |
| 52 // the layers that will be output as part of a call to layersAsJSON, | |
| 53 // if LayerTreeIncludesDebugInfo is specified. | |
|
wkorman
2016/12/15 21:36:05
This read to me as if the debug info will only be
chrishtr
2016/12/15 22:35:11
Done.
| |
| 51 void update( | 54 void update( |
| 52 const PaintArtifact&, | 55 const PaintArtifact&, |
| 53 RasterInvalidationTrackingMap<const PaintChunk>* paintChunkInvalidations); | 56 RasterInvalidationTrackingMap<const PaintChunk>* paintChunkInvalidations, |
| 57 bool storeDebugInfo); | |
| 54 | 58 |
| 55 // The root layer of the tree managed by this object. | 59 // The root layer of the tree managed by this object. |
| 56 cc::Layer* rootLayer() const { return m_rootLayer.get(); } | 60 cc::Layer* rootLayer() const { return m_rootLayer.get(); } |
| 57 | 61 |
| 58 // Wraps rootLayer(), so that it can be attached as a child of another | 62 // Wraps rootLayer(), so that it can be attached as a child of another |
| 59 // WebLayer. | 63 // WebLayer. |
| 60 WebLayer* getWebLayer() const { return m_webLayer.get(); } | 64 WebLayer* getWebLayer() const { return m_webLayer.get(); } |
| 61 | 65 |
| 62 // Returns extra information recorded during unit tests. | 66 // Returns extra information recorded during unit tests. |
| 63 // While not part of the normal output of this class, this provides a simple | 67 // While not part of the normal output of this class, this provides a simple |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 86 // Note: cc::Layer API assumes the layer bounds start at (0, 0), but the | 90 // Note: cc::Layer API assumes the layer bounds start at (0, 0), but the |
| 87 // bounding box of a paint chunk does not necessarily start at (0, 0) (and | 91 // bounding box of a paint chunk does not necessarily start at (0, 0) (and |
| 88 // could even be negative). Internally the generated layer translates the | 92 // could even be negative). Internally the generated layer translates the |
| 89 // paint chunk to align the bounding box to (0, 0) and return the actual | 93 // paint chunk to align the bounding box to (0, 0) and return the actual |
| 90 // origin of the paint chunk in the |layerOffset| outparam. | 94 // origin of the paint chunk in the |layerOffset| outparam. |
| 91 scoped_refptr<cc::Layer> layerForPaintChunk( | 95 scoped_refptr<cc::Layer> layerForPaintChunk( |
| 92 const PaintArtifact&, | 96 const PaintArtifact&, |
| 93 const PaintChunk&, | 97 const PaintChunk&, |
| 94 gfx::Vector2dF& layerOffset, | 98 gfx::Vector2dF& layerOffset, |
| 95 Vector<std::unique_ptr<ContentLayerClientImpl>>& newContentLayerClients, | 99 Vector<std::unique_ptr<ContentLayerClientImpl>>& newContentLayerClients, |
| 96 RasterInvalidationTracking*); | 100 RasterInvalidationTracking*, |
| 101 bool storeDebugInfo); | |
| 97 | 102 |
| 98 // Finds a client among the current vector of clients that matches the paint | 103 // Finds a client among the current vector of clients that matches the paint |
| 99 // chunk's id, or otherwise allocates a new one. | 104 // chunk's id, or otherwise allocates a new one. |
| 100 std::unique_ptr<ContentLayerClientImpl> clientForPaintChunk( | 105 std::unique_ptr<ContentLayerClientImpl> clientForPaintChunk( |
| 101 const PaintChunk&, | 106 const PaintChunk&, |
| 102 const PaintArtifact&); | 107 const PaintArtifact&); |
| 103 | 108 |
| 104 scoped_refptr<cc::Layer> m_rootLayer; | 109 scoped_refptr<cc::Layer> m_rootLayer; |
| 105 std::unique_ptr<WebLayer> m_webLayer; | 110 std::unique_ptr<WebLayer> m_webLayer; |
| 106 Vector<std::unique_ptr<ContentLayerClientImpl>> m_contentLayerClients; | 111 Vector<std::unique_ptr<ContentLayerClientImpl>> m_contentLayerClients; |
| 107 | 112 |
| 108 bool m_extraDataForTestingEnabled = false; | 113 bool m_extraDataForTestingEnabled = false; |
| 109 std::unique_ptr<ExtraDataForTesting> m_extraDataForTesting; | 114 std::unique_ptr<ExtraDataForTesting> m_extraDataForTesting; |
| 110 friend class StubChromeClientForSPv2; | 115 friend class StubChromeClientForSPv2; |
| 111 | 116 |
| 112 bool m_isTrackingRasterInvalidations; | 117 bool m_isTrackingRasterInvalidations; |
| 113 }; | 118 }; |
| 114 | 119 |
| 115 } // namespace blink | 120 } // namespace blink |
| 116 | 121 |
| 117 #endif // PaintArtifactCompositor_h | 122 #endif // PaintArtifactCompositor_h |
| OLD | NEW |