| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |