| 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_common.h" | 5 #include "cc/output/overlay_strategy_common.h" |
| 6 | 6 |
| 7 #include "cc/quads/solid_color_draw_quad.h" | 7 #include "cc/quads/solid_color_draw_quad.h" |
| 8 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 float device_scale_factor) { | 21 float device_scale_factor) { |
| 22 if (!capability_checker_) | 22 if (!capability_checker_) |
| 23 return false; | 23 return false; |
| 24 RenderPass* root_render_pass = render_passes_in_draw_order->back(); | 24 RenderPass* root_render_pass = render_passes_in_draw_order->back(); |
| 25 DCHECK(root_render_pass); | 25 DCHECK(root_render_pass); |
| 26 | 26 |
| 27 bool created_overlay = false; | 27 bool created_overlay = false; |
| 28 QuadList& quad_list = root_render_pass->quad_list; | 28 QuadList& quad_list = root_render_pass->quad_list; |
| 29 for (auto it = quad_list.begin(); it != quad_list.end();) { | 29 for (auto it = quad_list.begin(); it != quad_list.end();) { |
| 30 OverlayCandidate candidate; | 30 OverlayCandidate candidate; |
| 31 if (!OverlayCandidate::FromDrawQuad(*it, &candidate)) { | 31 if (!OverlayCandidate::IsAllowedQuad(*it) || |
| 32 !OverlayCandidate::FromDrawQuad(*it, &candidate)) { |
| 32 ++it; | 33 ++it; |
| 33 continue; | 34 continue; |
| 34 } | 35 } |
| 35 | 36 |
| 36 OverlayResult result = delegate_->TryOverlay( | 37 OverlayResult result = delegate_->TryOverlay( |
| 37 capability_checker_, render_passes_in_draw_order, candidate_list, | 38 capability_checker_, render_passes_in_draw_order, candidate_list, |
| 38 candidate, &it, device_scale_factor); | 39 candidate, &it, device_scale_factor); |
| 39 switch (result) { | 40 switch (result) { |
| 40 case DID_NOT_CREATE_OVERLAY: | 41 case DID_NOT_CREATE_OVERLAY: |
| 41 ++it; | 42 ++it; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 59 SkColor color = solid_quad->color; | 60 SkColor color = solid_quad->color; |
| 60 float opacity = solid_quad->shared_quad_state->opacity; | 61 float opacity = solid_quad->shared_quad_state->opacity; |
| 61 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity; | 62 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity; |
| 62 return solid_quad->ShouldDrawWithBlending() && | 63 return solid_quad->ShouldDrawWithBlending() && |
| 63 alpha < std::numeric_limits<float>::epsilon(); | 64 alpha < std::numeric_limits<float>::epsilon(); |
| 64 } | 65 } |
| 65 return false; | 66 return false; |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace cc | 69 } // namespace cc |
| OLD | NEW |