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/output/overlay_strategy_single_on_top.h" | 5 #include "cc/output/overlay_strategy_single_on_top.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Add the overlay. | 180 // Add the overlay. |
181 candidate.plane_z_order = 1; | 181 candidate.plane_z_order = 1; |
182 candidates.push_back(candidate); | 182 candidates.push_back(candidate); |
183 | 183 |
184 // Check for support. | 184 // Check for support. |
185 capability_checker_->CheckOverlaySupport(&candidates); | 185 capability_checker_->CheckOverlaySupport(&candidates); |
186 | 186 |
187 // If the candidate can be handled by an overlay, create a pass for it. | 187 // If the candidate can be handled by an overlay, create a pass for it. |
188 if (candidates[1].overlay_handled) { | 188 if (candidates[1].overlay_handled) { |
189 quad_list.EraseAndInvalidateAllPointers(candidate_iterator); | 189 quad_list.EraseAndInvalidateAllPointers(candidate_iterator); |
| 190 root_render_pass->overlay_rect = gfx::Rect(); |
| 191 for (const auto* quad : root_render_pass->quad_list) { |
| 192 if (quad->damaged) { |
| 193 gfx::RectF rect = gfx::RectF(quad->visible_rect); |
| 194 quad->quadTransform().TransformRect(&rect); |
| 195 root_render_pass->overlay_rect.Union(gfx::ToEnclosingRect(rect)); |
| 196 } |
| 197 } |
190 candidate_list->swap(candidates); | 198 candidate_list->swap(candidates); |
191 return true; | 199 return true; |
192 } | 200 } |
193 return false; | 201 return false; |
194 } | 202 } |
195 | 203 |
196 } // namespace cc | 204 } // namespace cc |
OLD | NEW |