Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: cc/output/overlay_strategy_fullscreen.cc

Issue 2476103002: Disable fullscren fb optimization with sw mirroring. (Closed)
Patch Set: We now call CheckOverlaySupport. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/overlay_strategy_fullscreen.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ui/gfx/geometry/rect_conversions.h" 11 #include "ui/gfx/geometry/rect_conversions.h"
12 #include "ui/gfx/geometry/size_conversions.h" 12 #include "ui/gfx/geometry/size_conversions.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 OverlayStrategyFullscreen::OverlayStrategyFullscreen() {} 16 OverlayStrategyFullscreen::OverlayStrategyFullscreen(
17 OverlayCandidateValidator* capability_checker)
18 : capability_checker_(capability_checker) {
19 DCHECK(capability_checker);
20 }
17 21
18 OverlayStrategyFullscreen::~OverlayStrategyFullscreen() {} 22 OverlayStrategyFullscreen::~OverlayStrategyFullscreen() {}
19 23
20 bool OverlayStrategyFullscreen::Attempt(ResourceProvider* resource_provider, 24 bool OverlayStrategyFullscreen::Attempt(ResourceProvider* resource_provider,
21 RenderPass* render_pass, 25 RenderPass* render_pass,
22 OverlayCandidateList* candidate_list) { 26 OverlayCandidateList* candidate_list) {
23 QuadList* quad_list = &render_pass->quad_list; 27 QuadList* quad_list = &render_pass->quad_list;
24 // First quad of quad_list is the top most quad. 28 // First quad of quad_list is the top most quad.
25 auto front = quad_list->begin(); 29 auto front = quad_list->begin();
26 while (front != quad_list->end()) { 30 while (front != quad_list->end()) {
(...skipping 18 matching lines...) Expand all
45 gfx::ToRoundedSize(candidate.display_rect.size()) != 49 gfx::ToRoundedSize(candidate.display_rect.size()) !=
46 render_pass->output_rect.size() || 50 render_pass->output_rect.size() ||
47 render_pass->output_rect.size() != candidate.resource_size_in_pixels) { 51 render_pass->output_rect.size() != candidate.resource_size_in_pixels) {
48 return false; 52 return false;
49 } 53 }
50 54
51 candidate.plane_z_order = 0; 55 candidate.plane_z_order = 0;
52 candidate.overlay_handled = true; 56 candidate.overlay_handled = true;
53 OverlayCandidateList new_candidate_list; 57 OverlayCandidateList new_candidate_list;
54 new_candidate_list.push_back(candidate); 58 new_candidate_list.push_back(candidate);
59 capability_checker_->CheckOverlaySupport(&new_candidate_list);
60 if (!new_candidate_list.front().overlay_handled)
61 return false;
62
55 candidate_list->swap(new_candidate_list); 63 candidate_list->swap(new_candidate_list);
64
56 render_pass->quad_list = QuadList(); // Remove all the quads 65 render_pass->quad_list = QuadList(); // Remove all the quads
57 return true; 66 return true;
58 } 67 }
59 68
60 } // namespace cc 69 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_strategy_fullscreen.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698