Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: cc/layers/layer_impl.cc

Issue 1841443003: cc : Use effect tree to determine if a layer is inside copy request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/texture_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 gfx::Rect request_in_layer_space = request->area(); 285 gfx::Rect request_in_layer_space = request->area();
286 request_in_layer_space.Intersect(gfx::Rect(bounds())); 286 request_in_layer_space.Intersect(gfx::Rect(bounds()));
287 request->set_area(MathUtil::MapEnclosingClippedRect( 287 request->set_area(MathUtil::MapEnclosingClippedRect(
288 DrawTransform(), request_in_layer_space)); 288 DrawTransform(), request_in_layer_space));
289 } 289 }
290 290
291 layer_tree_impl()->RemoveLayerWithCopyOutputRequest(this); 291 layer_tree_impl()->RemoveLayerWithCopyOutputRequest(this);
292 layer_tree_impl()->set_needs_update_draw_properties(); 292 layer_tree_impl()->set_needs_update_draw_properties();
293 } 293 }
294 294
295 bool LayerImpl::AnchestorHasCopyRequest() const { 295 bool LayerImpl::InsideCopyRequest() const {
296 for (const LayerImpl* layer = this; layer; layer = layer->parent()) { 296 EffectTree& effect_tree = layer_tree_impl()->property_trees()->effect_tree;
297 if (layer->HasCopyRequest()) 297 EffectNode* node = effect_tree.Node(effect_tree_index_);
298
299 for (; node; node = effect_tree.parent(node)) {
300 if (node->data.has_copy_request)
298 return true; 301 return true;
299 } 302 }
300 return false; 303 return false;
301 } 304 }
302 305
303 void LayerImpl::ClearRenderSurfaceLayerList() { 306 void LayerImpl::ClearRenderSurfaceLayerList() {
304 if (render_surface_) 307 if (render_surface_)
305 render_surface_->ClearLayerLists(); 308 render_surface_->ClearLayerLists();
306 } 309 }
307 310
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 .layer_transforms_should_scale_layer_contents) { 1585 .layer_transforms_should_scale_layer_contents) {
1583 return default_scale; 1586 return default_scale;
1584 } 1587 }
1585 1588
1586 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( 1589 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents(
1587 DrawTransform(), default_scale); 1590 DrawTransform(), default_scale);
1588 return std::max(transform_scales.x(), transform_scales.y()); 1591 return std::max(transform_scales.x(), transform_scales.y());
1589 } 1592 }
1590 1593
1591 } // namespace cc 1594 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/texture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698