Chromium Code Reviews| 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 20 matching lines...) Expand all Loading... | |
| 31 auto front = quad_list->begin(); | 31 auto front = quad_list->begin(); |
| 32 while (front != quad_list->end()) { | 32 while (front != quad_list->end()) { |
| 33 if (!OverlayCandidate::IsInvisibleQuad(*front)) | 33 if (!OverlayCandidate::IsInvisibleQuad(*front)) |
| 34 break; | 34 break; |
| 35 front++; | 35 front++; |
| 36 } | 36 } |
| 37 | 37 |
| 38 if (front == quad_list->end()) | 38 if (front == quad_list->end()) |
| 39 return false; | 39 return false; |
| 40 | 40 |
| 41 const DrawQuad* quad = *front; | |
| 42 if (quad->ShouldDrawWithBlending() || | |
| 43 quad->shared_quad_state->opacity != 1.f || | |
| 44 quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver) | |
|
reveman
2017/03/08 21:40:49
what about SkBlendMode::kSrc? Android uses this wh
Daniele Castagna
2017/03/13 02:09:19
Just wanted to keep it consistent with the check w
reveman
2017/03/13 02:14:49
Play store should be enough to test this I think.
Daniele Castagna
2017/03/13 02:24:04
Play store uses kSrcOver, otherwise we'd reject it
Daniele Castagna
2017/03/13 03:32:56
Play Store is kSrcOver.
reveman
2017/03/13 11:58:12
Android M or N? What's the format of the buffer? I
| |
| 45 return false; | |
| 46 | |
| 41 OverlayCandidate candidate; | 47 OverlayCandidate candidate; |
| 42 if (!OverlayCandidate::FromDrawQuad(resource_provider, *front, &candidate)) { | 48 if (!OverlayCandidate::FromDrawQuad(resource_provider, quad, &candidate)) { |
| 43 return false; | 49 return false; |
| 44 } | 50 } |
| 45 | 51 |
| 46 if (candidate.transform != gfx::OVERLAY_TRANSFORM_NONE) { | 52 if (candidate.transform != gfx::OVERLAY_TRANSFORM_NONE) { |
| 47 return false; | 53 return false; |
| 48 } | 54 } |
| 49 | 55 |
| 50 if (!candidate.display_rect.origin().IsOrigin() || | 56 if (!candidate.display_rect.origin().IsOrigin() || |
| 51 gfx::ToRoundedSize(candidate.display_rect.size()) != | 57 gfx::ToRoundedSize(candidate.display_rect.size()) != |
| 52 render_pass->output_rect.size() || | 58 render_pass->output_rect.size() || |
| 53 render_pass->output_rect.size() != candidate.resource_size_in_pixels) { | 59 render_pass->output_rect.size() != candidate.resource_size_in_pixels) { |
| 54 return false; | 60 return false; |
| 55 } | 61 } |
| 56 | 62 |
| 57 candidate.plane_z_order = 0; | 63 candidate.plane_z_order = 0; |
| 58 candidate.overlay_handled = true; | 64 candidate.overlay_handled = true; |
| 59 OverlayCandidateList new_candidate_list; | 65 OverlayCandidateList new_candidate_list; |
| 60 new_candidate_list.push_back(candidate); | 66 new_candidate_list.push_back(candidate); |
| 61 capability_checker_->CheckOverlaySupport(&new_candidate_list); | 67 capability_checker_->CheckOverlaySupport(&new_candidate_list); |
| 62 if (!new_candidate_list.front().overlay_handled) | 68 if (!new_candidate_list.front().overlay_handled) |
| 63 return false; | 69 return false; |
| 64 | 70 |
| 65 candidate_list->swap(new_candidate_list); | 71 candidate_list->swap(new_candidate_list); |
| 66 | 72 |
| 67 render_pass->quad_list = QuadList(); // Remove all the quads | 73 render_pass->quad_list = QuadList(); // Remove all the quads |
| 68 return true; | 74 return true; |
| 69 } | 75 } |
| 70 | 76 |
| 71 } // namespace cc | 77 } // namespace cc |
| OLD | NEW |