OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_fullscreen.h" | 5 #include "cc/output/overlay_strategy_fullscreen.h" |
6 | 6 |
7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
8 #include "cc/output/overlay_candidate_validator.h" | 8 #include "cc/output/overlay_candidate_validator.h" |
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 29 matching lines...) Expand all Loading... |
40 | 40 |
41 const DrawQuad* quad = *front; | 41 const DrawQuad* quad = *front; |
42 if (quad->ShouldDrawWithBlending()) | 42 if (quad->ShouldDrawWithBlending()) |
43 return false; | 43 return false; |
44 | 44 |
45 OverlayCandidate candidate; | 45 OverlayCandidate candidate; |
46 if (!OverlayCandidate::FromDrawQuad(resource_provider, quad, &candidate)) { | 46 if (!OverlayCandidate::FromDrawQuad(resource_provider, quad, &candidate)) { |
47 return false; | 47 return false; |
48 } | 48 } |
49 | 49 |
50 if (candidate.transform != gfx::OVERLAY_TRANSFORM_NONE) { | |
51 return false; | |
52 } | |
53 | |
54 if (!candidate.display_rect.origin().IsOrigin() || | 50 if (!candidate.display_rect.origin().IsOrigin() || |
55 gfx::ToRoundedSize(candidate.display_rect.size()) != | 51 gfx::ToRoundedSize(candidate.display_rect.size()) != |
56 render_pass->output_rect.size() || | 52 render_pass->output_rect.size() || |
57 render_pass->output_rect.size() != candidate.resource_size_in_pixels) { | 53 render_pass->output_rect.size() != candidate.resource_size_in_pixels) { |
58 return false; | 54 return false; |
59 } | 55 } |
60 | 56 |
61 candidate.plane_z_order = 0; | 57 candidate.plane_z_order = 0; |
62 candidate.overlay_handled = true; | 58 candidate.overlay_handled = true; |
63 OverlayCandidateList new_candidate_list; | 59 OverlayCandidateList new_candidate_list; |
64 new_candidate_list.push_back(candidate); | 60 new_candidate_list.push_back(candidate); |
65 capability_checker_->CheckOverlaySupport(&new_candidate_list); | 61 capability_checker_->CheckOverlaySupport(&new_candidate_list); |
66 if (!new_candidate_list.front().overlay_handled) | 62 if (!new_candidate_list.front().overlay_handled) |
67 return false; | 63 return false; |
68 | 64 |
69 candidate_list->swap(new_candidate_list); | 65 candidate_list->swap(new_candidate_list); |
70 | 66 |
71 render_pass->quad_list = QuadList(); // Remove all the quads | 67 render_pass->quad_list = QuadList(); // Remove all the quads |
72 return true; | 68 return true; |
73 } | 69 } |
74 | 70 |
75 } // namespace cc | 71 } // namespace cc |
OLD | NEW |