| 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 "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // changes in the paint artifact. | 26 // changes in the paint artifact. |
| 27 // | 27 // |
| 28 // PaintArtifactCompositor is the successor to PaintLayerCompositor, reflecting | 28 // PaintArtifactCompositor is the successor to PaintLayerCompositor, reflecting |
| 29 // the new home of compositing decisions after paint in Slimming Paint v2. | 29 // the new home of compositing decisions after paint in Slimming Paint v2. |
| 30 class PLATFORM_EXPORT PaintArtifactCompositor { | 30 class PLATFORM_EXPORT PaintArtifactCompositor { |
| 31 WTF_MAKE_NONCOPYABLE(PaintArtifactCompositor); | 31 WTF_MAKE_NONCOPYABLE(PaintArtifactCompositor); |
| 32 public: | 32 public: |
| 33 PaintArtifactCompositor(); | 33 PaintArtifactCompositor(); |
| 34 ~PaintArtifactCompositor(); | 34 ~PaintArtifactCompositor(); |
| 35 | 35 |
| 36 // Creates at least a root layer to be managed by this controller. Can't be | |
| 37 // done in the constructor, since RuntimeEnabledFeatures may not be | |
| 38 // initialized yet. | |
| 39 void initializeIfNeeded(); | |
| 40 | |
| 41 // Updates the layer tree to match the provided paint artifact. | 36 // Updates the layer tree to match the provided paint artifact. |
| 42 // Creates the root layer if not already done. | 37 // Creates the root layer if not already done. |
| 43 void update(const PaintArtifact&); | 38 void update(const PaintArtifact&); |
| 44 | 39 |
| 45 // The root layer of the tree managed by this object. | 40 // The root layer of the tree managed by this object. |
| 46 cc::Layer* rootLayer() const { return m_rootLayer.get(); } | 41 cc::Layer* rootLayer() const { return m_rootLayer.get(); } |
| 47 | 42 |
| 48 // Wraps rootLayer(), so that it can be attached as a child of another | 43 // Wraps rootLayer(), so that it can be attached as a child of another |
| 49 // WebLayer. | 44 // WebLayer. |
| 50 WebLayer* webLayer() const { return m_webLayer.get(); } | 45 WebLayer* webLayer() const { return m_webLayer.get(); } |
| 51 | 46 |
| 52 private: | 47 private: |
| 53 class ContentLayerClientImpl; | 48 class ContentLayerClientImpl; |
| 54 | 49 |
| 55 scoped_refptr<cc::Layer> m_rootLayer; | 50 scoped_refptr<cc::Layer> m_rootLayer; |
| 56 OwnPtr<WebLayer> m_webLayer; | 51 OwnPtr<WebLayer> m_webLayer; |
| 57 Vector<OwnPtr<ContentLayerClientImpl>> m_contentLayerClients; | 52 Vector<OwnPtr<ContentLayerClientImpl>> m_contentLayerClients; |
| 58 | 53 |
| 59 // For ~PaintArtifactCompositor on MSVC. | 54 // For ~PaintArtifactCompositor on MSVC. |
| 60 friend struct WTF::OwnedPtrDeleter<ContentLayerClientImpl>; | 55 friend struct WTF::OwnedPtrDeleter<ContentLayerClientImpl>; |
| 61 }; | 56 }; |
| 62 | 57 |
| 63 } // namespace blink | 58 } // namespace blink |
| 64 | 59 |
| 65 #endif // PaintArtifactCompositor_h | 60 #endif // PaintArtifactCompositor_h |
| OLD | NEW |