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

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

Issue 13975019: Merge 194269 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1479/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // Mask layers don't get this call, so explicitly update them so they can 261 // Mask layers don't get this call, so explicitly update them so they can
262 // kick off tile rasterization. 262 // kick off tile rasterization.
263 if (layer->mask_layer()) 263 if (layer->mask_layer())
264 layer->mask_layer()->UpdateTilePriorities(); 264 layer->mask_layer()->UpdateTilePriorities();
265 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) 265 if (layer->replica_layer() && layer->replica_layer()->mask_layer())
266 layer->replica_layer()->mask_layer()->UpdateTilePriorities(); 266 layer->replica_layer()->mask_layer()->UpdateTilePriorities();
267 } 267 }
268 268
269 static inline void UpdateTilePrioritiesForLayer(Layer* layer) {} 269 static inline void UpdateTilePrioritiesForLayer(Layer* layer) {}
270 270
271 static inline void SavePaintPropertiesLayer(LayerImpl* layer) {}
272
273 static inline void SavePaintPropertiesLayer(Layer* layer) {
274 layer->SavePaintProperties();
275
276 if (layer->mask_layer())
277 layer->mask_layer()->SavePaintProperties();
278 if (layer->replica_layer() && layer->replica_layer()->mask_layer())
279 layer->replica_layer()->mask_layer()->SavePaintProperties();
280 }
281
271 template <typename LayerType> 282 template <typename LayerType>
272 static bool SubtreeShouldRenderToSeparateSurface( 283 static bool SubtreeShouldRenderToSeparateSurface(
273 LayerType* layer, 284 LayerType* layer,
274 bool axis_aligned_with_respect_to_parent) { 285 bool axis_aligned_with_respect_to_parent) {
275 // 286 //
276 // A layer and its descendants should render onto a new RenderSurfaceImpl if 287 // A layer and its descendants should render onto a new RenderSurfaceImpl if
277 // any of these rules hold: 288 // any of these rules hold:
278 // 289 //
279 290
280 // The root layer should always have a render_surface. 291 // The root layer should always have a render_surface.
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 *drawable_content_rect_of_subtree = 1413 *drawable_content_rect_of_subtree =
1403 gfx::ToEnclosingRect(layer->render_surface()->DrawableContentRect()); 1414 gfx::ToEnclosingRect(layer->render_surface()->DrawableContentRect());
1404 } else { 1415 } else {
1405 *drawable_content_rect_of_subtree = local_drawable_content_rect_of_subtree; 1416 *drawable_content_rect_of_subtree = local_drawable_content_rect_of_subtree;
1406 } 1417 }
1407 1418
1408 if (layer->HasContributingDelegatedRenderPasses()) { 1419 if (layer->HasContributingDelegatedRenderPasses()) {
1409 layer->render_target()->render_surface()-> 1420 layer->render_target()->render_surface()->
1410 AddContributingDelegatedRenderPassLayer(layer); 1421 AddContributingDelegatedRenderPassLayer(layer);
1411 } 1422 }
1423
1424 SavePaintPropertiesLayer(layer);
1412 } 1425 }
1413 1426
1414 void LayerTreeHostCommon::CalculateDrawProperties( 1427 void LayerTreeHostCommon::CalculateDrawProperties(
1415 Layer* root_layer, 1428 Layer* root_layer,
1416 gfx::Size device_viewport_size, 1429 gfx::Size device_viewport_size,
1417 float device_scale_factor, 1430 float device_scale_factor,
1418 float page_scale_factor, 1431 float page_scale_factor,
1419 int max_texture_size, 1432 int max_texture_size,
1420 bool can_use_lcd_text, 1433 bool can_use_lcd_text,
1421 LayerList* render_surface_layer_list) { 1434 LayerList* render_surface_layer_list) {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 // At this point, we think the point does hit the touch event handler region 1715 // At this point, we think the point does hit the touch event handler region
1703 // on the layer, but we need to walk up the parents to ensure that the layer 1716 // on the layer, but we need to walk up the parents to ensure that the layer
1704 // was not clipped in such a way that the hit point actually should not hit 1717 // was not clipped in such a way that the hit point actually should not hit
1705 // the layer. 1718 // the layer.
1706 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) 1719 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl))
1707 return false; 1720 return false;
1708 1721
1709 return true; 1722 return true;
1710 } 1723 }
1711 } // namespace cc 1724 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698