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

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

Issue 2345793003: Include viewport clip in visible rect of unclipped surfaces (2) (Closed)
Patch Set: delete test Created 4 years, 3 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/trees/property_tree.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 void ClipTree::SetViewportClip(gfx::RectF viewport_rect) { 1105 void ClipTree::SetViewportClip(gfx::RectF viewport_rect) {
1106 if (size() < 2) 1106 if (size() < 2)
1107 return; 1107 return;
1108 ClipNode* node = Node(1); 1108 ClipNode* node = Node(1);
1109 if (viewport_rect == node->clip) 1109 if (viewport_rect == node->clip)
1110 return; 1110 return;
1111 node->clip = viewport_rect; 1111 node->clip = viewport_rect;
1112 set_needs_update(true); 1112 set_needs_update(true);
1113 } 1113 }
1114 1114
1115 gfx::RectF ClipTree::ViewportClip() { 1115 gfx::RectF ClipTree::ViewportClip() const {
1116 const unsigned long min_size = 1; 1116 const unsigned long min_size = 1;
1117 DCHECK_GT(size(), min_size); 1117 DCHECK_GT(size(), min_size);
1118 return Node(kViewportNodeId)->clip; 1118 return Node(kViewportNodeId)->clip;
1119 } 1119 }
1120 1120
1121 bool ClipTree::operator==(const ClipTree& other) const { 1121 bool ClipTree::operator==(const ClipTree& other) const {
1122 return PropertyTree::operator==(other); 1122 return PropertyTree::operator==(other);
1123 } 1123 }
1124 1124
1125 void ClipTree::ToProtobuf(proto::PropertyTree* proto) const { 1125 void ClipTree::ToProtobuf(proto::PropertyTree* proto) const {
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 from_target.ConcatTransform(draw_transforms.from_target); 2248 from_target.ConcatTransform(draw_transforms.from_target);
2249 from_target.Scale(effect_node->surface_contents_scale.x(), 2249 from_target.Scale(effect_node->surface_contents_scale.x(),
2250 effect_node->surface_contents_scale.y()); 2250 effect_node->surface_contents_scale.y());
2251 DCHECK(from_target.ApproximatelyEqual(*transform) || 2251 DCHECK(from_target.ApproximatelyEqual(*transform) ||
2252 !draw_transforms.invertible); 2252 !draw_transforms.invertible);
2253 } 2253 }
2254 return success; 2254 return success;
2255 } 2255 }
2256 2256
2257 } // namespace cc 2257 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698