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 #include "platform/graphics/compositing/PaintArtifactCompositor.h" | 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
6 | 6 |
7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
9 #include "cc/layers/picture_layer.h" | 9 #include "cc/layers/picture_layer.h" |
10 #include "cc/playback/display_item_list.h" | 10 #include "cc/playback/display_item_list.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 String m_debugName; | 156 String m_debugName; |
157 scoped_refptr<cc::PictureLayer> m_ccPictureLayer; | 157 scoped_refptr<cc::PictureLayer> m_ccPictureLayer; |
158 scoped_refptr<cc::DisplayItemList> m_ccDisplayItemList; | 158 scoped_refptr<cc::DisplayItemList> m_ccDisplayItemList; |
159 gfx::Rect m_paintableRegion; | 159 gfx::Rect m_paintableRegion; |
160 }; | 160 }; |
161 | 161 |
162 PaintArtifactCompositor::PaintArtifactCompositor() { | 162 PaintArtifactCompositor::PaintArtifactCompositor() { |
163 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 163 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
164 return; | 164 return; |
165 m_rootLayer = cc::Layer::Create(); | 165 m_rootLayer = cc::Layer::Create(); |
166 m_webLayer = wrapUnique( | 166 m_webLayer = Platform::current()->compositorSupport()->createLayerFromCCLayer( |
167 Platform::current()->compositorSupport()->createLayerFromCCLayer( | 167 m_rootLayer.get()); |
168 m_rootLayer.get())); | |
169 m_isTrackingRasterInvalidations = false; | 168 m_isTrackingRasterInvalidations = false; |
170 } | 169 } |
171 | 170 |
172 PaintArtifactCompositor::~PaintArtifactCompositor() {} | 171 PaintArtifactCompositor::~PaintArtifactCompositor() {} |
173 | 172 |
174 void PaintArtifactCompositor::setTracksRasterInvalidations( | 173 void PaintArtifactCompositor::setTracksRasterInvalidations( |
175 bool tracksPaintInvalidations) { | 174 bool tracksPaintInvalidations) { |
176 resetTrackedRasterInvalidations(); | 175 resetTrackedRasterInvalidations(); |
177 m_isTrackingRasterInvalidations = tracksPaintInvalidations; | 176 m_isTrackingRasterInvalidations = tracksPaintInvalidations; |
178 } | 177 } |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 } | 761 } |
763 m_contentLayerClients.clear(); | 762 m_contentLayerClients.clear(); |
764 m_contentLayerClients.swap(newContentLayerClients); | 763 m_contentLayerClients.swap(newContentLayerClients); |
765 | 764 |
766 // Mark the property trees as having been rebuilt. | 765 // Mark the property trees as having been rebuilt. |
767 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber; | 766 layerTree->property_trees()->sequence_number = kPropertyTreeSequenceNumber; |
768 layerTree->property_trees()->needs_rebuild = false; | 767 layerTree->property_trees()->needs_rebuild = false; |
769 } | 768 } |
770 | 769 |
771 } // namespace blink | 770 } // namespace blink |
OLD | NEW |