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

Side by Side Diff: cc/trees/layer_tree_host_common.cc

Issue 16968002: Move implementation of WebFilterOperations into cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl_unittest.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 return true; 304 return true;
305 } 305 }
306 306
307 // If the layer has a reflection. 307 // If the layer has a reflection.
308 if (layer->replica_layer()) { 308 if (layer->replica_layer()) {
309 DCHECK(!is_root); 309 DCHECK(!is_root);
310 return true; 310 return true;
311 } 311 }
312 312
313 // If the layer uses a CSS filter. 313 // If the layer uses a CSS filter.
314 if (!layer->filters().isEmpty() || !layer->background_filters().isEmpty() || 314 if (!layer->filters().IsEmpty() || !layer->background_filters().IsEmpty() ||
315 layer->filter()) { 315 layer->filter()) {
316 DCHECK(!is_root); 316 DCHECK(!is_root);
317 return true; 317 return true;
318 } 318 }
319 319
320 int num_descendants_that_draw_content = 320 int num_descendants_that_draw_content =
321 layer->draw_properties().num_descendants_that_draw_content; 321 layer->draw_properties().num_descendants_that_draw_content;
322 322
323 // If the layer flattens its subtree (i.e. the layer doesn't preserve-3d), but 323 // If the layer flattens its subtree (i.e. the layer doesn't preserve-3d), but
324 // it is treated as a 3D object by its parent (i.e. parent does preserve-3d). 324 // it is treated as a 3D object by its parent (i.e. parent does preserve-3d).
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 DrawProperties<LayerType, RenderSurfaceType>& 1191 DrawProperties<LayerType, RenderSurfaceType>&
1192 replica_mask_draw_properties = 1192 replica_mask_draw_properties =
1193 layer->replica_layer()->mask_layer()->draw_properties(); 1193 layer->replica_layer()->mask_layer()->draw_properties();
1194 replica_mask_draw_properties.render_target = layer; 1194 replica_mask_draw_properties.render_target = layer;
1195 replica_mask_draw_properties.visible_content_rect = 1195 replica_mask_draw_properties.visible_content_rect =
1196 gfx::Rect(layer->content_bounds()); 1196 gfx::Rect(layer->content_bounds());
1197 } 1197 }
1198 1198
1199 // TODO(senorblanco): make this smarter for the SkImageFilter case (check 1199 // TODO(senorblanco): make this smarter for the SkImageFilter case (check
1200 // for pixel-moving filters) 1200 // for pixel-moving filters)
1201 if (layer->filters().hasFilterThatMovesPixels() || layer->filter()) 1201 if (layer->filters().HasFilterThatMovesPixels() || layer->filter())
1202 nearest_ancestor_that_moves_pixels = render_surface; 1202 nearest_ancestor_that_moves_pixels = render_surface;
1203 1203
1204 // The render surface clip rect is expressed in the space where this surface 1204 // The render surface clip rect is expressed in the space where this surface
1205 // draws, i.e. the same space as clip_rect_from_ancestor. 1205 // draws, i.e. the same space as clip_rect_from_ancestor.
1206 render_surface->SetIsClipped(ancestor_clips_subtree); 1206 render_surface->SetIsClipped(ancestor_clips_subtree);
1207 if (ancestor_clips_subtree) { 1207 if (ancestor_clips_subtree) {
1208 render_surface->SetClipRect(clip_rect_from_ancestor); 1208 render_surface->SetClipRect(clip_rect_from_ancestor);
1209 1209
1210 gfx::Transform inverse_surface_draw_transform( 1210 gfx::Transform inverse_surface_draw_transform(
1211 gfx::Transform::kSkipInitialization); 1211 gfx::Transform::kSkipInitialization);
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1822 // At this point, we think the point does hit the touch event handler region 1822 // At this point, we think the point does hit the touch event handler region
1823 // on the layer, but we need to walk up the parents to ensure that the layer 1823 // on the layer, but we need to walk up the parents to ensure that the layer
1824 // was not clipped in such a way that the hit point actually should not hit 1824 // was not clipped in such a way that the hit point actually should not hit
1825 // the layer. 1825 // the layer.
1826 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) 1826 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl))
1827 return false; 1827 return false;
1828 1828
1829 return true; 1829 return true;
1830 } 1830 }
1831 } // namespace cc 1831 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698