| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_sandwich.h" | 5 #include "cc/output/overlay_strategy_sandwich.h" |
| 6 | 6 |
| 7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
| 8 #include "cc/base/region.h" | 8 #include "cc/base/region.h" |
| 9 #include "cc/output/overlay_candidate_validator.h" | 9 #include "cc/output/overlay_candidate_validator.h" |
| 10 #include "cc/quads/draw_quad.h" | 10 #include "cc/quads/draw_quad.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 1.f / pixel_bounds.height()); | 110 1.f / pixel_bounds.height()); |
| 111 main_image_on_top.plane_z_order = 2; | 111 main_image_on_top.plane_z_order = 2; |
| 112 main_image_on_top.transform = gfx::OVERLAY_TRANSFORM_NONE; | 112 main_image_on_top.transform = gfx::OVERLAY_TRANSFORM_NONE; |
| 113 main_image_on_top.use_output_surface_for_resource = true; | 113 main_image_on_top.use_output_surface_for_resource = true; |
| 114 new_candidate_list.push_back(main_image_on_top); | 114 new_candidate_list.push_back(main_image_on_top); |
| 115 } | 115 } |
| 116 | 116 |
| 117 // Check for support. | 117 // Check for support. |
| 118 capability_checker->CheckOverlaySupport(&new_candidate_list); | 118 capability_checker->CheckOverlaySupport(&new_candidate_list); |
| 119 for (const OverlayCandidate& candidate : new_candidate_list) { | 119 for (const OverlayCandidate& candidate : new_candidate_list) { |
| 120 if (candidate.plane_z_order > 0 && !candidate.overlay_handled) | 120 if (!candidate.overlay_handled) |
| 121 return DID_NOT_CREATE_OVERLAY; | 121 return DID_NOT_CREATE_OVERLAY; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Remove the quad for the overlay quad. Replace it with a transparent quad | 124 // Remove the quad for the overlay quad. Replace it with a transparent quad |
| 125 // if we're putting a new overlay on top. | 125 // if we're putting a new overlay on top. |
| 126 if (pixel_covered_rects.empty()) { | 126 if (pixel_covered_rects.empty()) { |
| 127 *candidate_iter_in_quad_list = | 127 *candidate_iter_in_quad_list = |
| 128 quad_list.EraseAndInvalidateAllPointers(*candidate_iter_in_quad_list); | 128 quad_list.EraseAndInvalidateAllPointers(*candidate_iter_in_quad_list); |
| 129 } else { | 129 } else { |
| 130 // Cache the information from the candidate quad that we'll need to | 130 // Cache the information from the candidate quad that we'll need to |
| (...skipping 23 matching lines...) Expand all Loading... |
| 154 SK_ColorTRANSPARENT, true); | 154 SK_ColorTRANSPARENT, true); |
| 155 ++(*candidate_iter_in_quad_list); | 155 ++(*candidate_iter_in_quad_list); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 candidate_list->swap(new_candidate_list); | 159 candidate_list->swap(new_candidate_list); |
| 160 return CREATED_OVERLAY_KEEP_LOOKING; | 160 return CREATED_OVERLAY_KEEP_LOOKING; |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace cc | 163 } // namespace cc |
| OLD | NEW |