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 "cc/trees/occlusion.h" | 5 #include "cc/trees/occlusion.h" |
6 | 6 |
7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
8 #include "ui/gfx/geometry/rect.h" | 8 #include "ui/gfx/geometry/rect.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // These subtract operations are more lossy than if we did both operations at | 78 // These subtract operations are more lossy than if we did both operations at |
79 // once. | 79 // once. |
80 unoccluded_rect_in_target_surface.Subtract( | 80 unoccluded_rect_in_target_surface.Subtract( |
81 occlusion_from_inside_target_.bounds()); | 81 occlusion_from_inside_target_.bounds()); |
82 unoccluded_rect_in_target_surface.Subtract( | 82 unoccluded_rect_in_target_surface.Subtract( |
83 occlusion_from_outside_target_.bounds()); | 83 occlusion_from_outside_target_.bounds()); |
84 | 84 |
85 return unoccluded_rect_in_target_surface; | 85 return unoccluded_rect_in_target_surface; |
86 } | 86 } |
87 | 87 |
| 88 bool Occlusion::IsEqual(const Occlusion& other) const { |
| 89 return draw_transform_ == other.draw_transform_ && |
| 90 occlusion_from_inside_target_ == other.occlusion_from_inside_target_ && |
| 91 occlusion_from_outside_target_ == other.occlusion_from_outside_target_; |
| 92 } |
| 93 |
| 94 std::string Occlusion::ToString() const { |
| 95 return draw_transform_.ToString() + "outside(" + |
| 96 occlusion_from_outside_target_.ToString() + ") inside(" + |
| 97 occlusion_from_inside_target_.ToString() + ")"; |
| 98 } |
| 99 |
88 } // namespace cc | 100 } // namespace cc |
OLD | NEW |