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

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

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Fix for patch 1. Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/draw_property_utils.h" 5 #include "cc/trees/draw_property_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 bool is_clipped; 548 bool is_clipped;
549 if (render_surface->EffectTreeIndex() == EffectTree::kContentsRootNodeId) { 549 if (render_surface->EffectTreeIndex() == EffectTree::kContentsRootNodeId) {
550 // Root render surface is always clipped. 550 // Root render surface is always clipped.
551 is_clipped = true; 551 is_clipped = true;
552 } else if (render_surface->has_contributing_layer_that_escapes_clip()) { 552 } else if (render_surface->has_contributing_layer_that_escapes_clip()) {
553 // We cannot clip a surface that has a contribuitng layer which escapes the 553 // We cannot clip a surface that has a contribuitng layer which escapes the
554 // clip. 554 // clip.
555 is_clipped = false; 555 is_clipped = false;
556 } else if (render_surface->ClipTreeIndex() == 556 } else if (render_surface->ClipTreeIndex() ==
557 render_surface->render_target()->ClipTreeIndex()) { 557 render_surface->render_target()->ClipTreeIndex()) {
558 // There is no clip between between the render surface and its target, so 558 // There is no clip between the render surface and its target, so
559 // the surface need not be clipped. 559 // the surface need not be clipped.
560 is_clipped = false; 560 is_clipped = false;
561 } else if (render_surface->ForceRenderSurface()) {
562 // Avoid clipping when force use of render surface. We might need the whole
563 // surface during some animations.
564 is_clipped = false;
561 } else { 565 } else {
562 // If the clips between the render surface and its target only expand the 566 // If the clips between the render surface and its target only expand the
563 // clips and do not apply any new clip, we need not clip the render surface. 567 // clips and do not apply any new clip, we need not clip the render surface.
564 const ClipNode* clip_node = clip_tree.Node(render_surface->ClipTreeIndex()); 568 const ClipNode* clip_node = clip_tree.Node(render_surface->ClipTreeIndex());
565 is_clipped = clip_node->clip_type != ClipNode::ClipType::EXPANDS_CLIP; 569 is_clipped = clip_node->clip_type != ClipNode::ClipType::EXPANDS_CLIP;
566 } 570 }
567 render_surface->SetIsClipped(is_clipped); 571 render_surface->SetIsClipped(is_clipped);
568 } 572 }
569 573
570 static void SetSurfaceDrawOpacity(const EffectTree& tree, 574 static void SetSurfaceDrawOpacity(const EffectTree& tree,
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 void UpdateElasticOverscroll(PropertyTrees* property_trees, 1067 void UpdateElasticOverscroll(PropertyTrees* property_trees,
1064 const Layer* overscroll_elasticity_layer, 1068 const Layer* overscroll_elasticity_layer,
1065 const gfx::Vector2dF& elastic_overscroll) { 1069 const gfx::Vector2dF& elastic_overscroll) {
1066 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, 1070 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer,
1067 elastic_overscroll); 1071 elastic_overscroll);
1068 } 1072 }
1069 1073
1070 } // namespace draw_property_utils 1074 } // namespace draw_property_utils
1071 1075
1072 } // namespace cc 1076 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698