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

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

Issue 1387283002: cc: Remove redundant is_overlay arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo changes on overlay_strategy_single_on_top.cc Created 5 years, 2 months 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_all_or_nothing.h ('k') | cc/output/overlay_strategy_sandwich.h » ('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 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_all_or_nothing.h" 5 #include "cc/output/overlay_strategy_all_or_nothing.h"
6 6
7 #include "cc/output/overlay_candidate_validator.h" 7 #include "cc/output/overlay_candidate_validator.h"
8 #include "cc/quads/draw_quad.h" 8 #include "cc/quads/draw_quad.h"
9 9
10 namespace cc { 10 namespace cc {
11 11
12 OverlayStrategyAllOrNothing::OverlayStrategyAllOrNothing( 12 OverlayStrategyAllOrNothing::OverlayStrategyAllOrNothing(
13 OverlayCandidateValidator* capability_checker) 13 OverlayCandidateValidator* capability_checker)
14 : capability_checker_(capability_checker) { 14 : capability_checker_(capability_checker) {
15 DCHECK(capability_checker); 15 DCHECK(capability_checker);
16 } 16 }
17 17
18 OverlayStrategyAllOrNothing::~OverlayStrategyAllOrNothing() {} 18 OverlayStrategyAllOrNothing::~OverlayStrategyAllOrNothing() {}
19 19
20 bool OverlayStrategyAllOrNothing::Attempt(RenderPassList* render_passes, 20 bool OverlayStrategyAllOrNothing::Attempt(ResourceProvider* resource_provider,
21 RenderPassList* render_passes,
21 OverlayCandidateList* candidates) { 22 OverlayCandidateList* candidates) {
22 QuadList& quad_list = render_passes->back()->quad_list; 23 QuadList& quad_list = render_passes->back()->quad_list;
23 OverlayCandidateList new_candidates; 24 OverlayCandidateList new_candidates;
24 int next_z_order = -1; 25 int next_z_order = -1;
25 26
26 for (const DrawQuad* quad : quad_list) { 27 for (const DrawQuad* quad : quad_list) {
27 OverlayCandidate candidate; 28 OverlayCandidate candidate;
28 if (!OverlayCandidate::FromDrawQuad(quad, &candidate)) 29 if (!OverlayCandidate::FromDrawQuad(resource_provider, quad, &candidate))
29 return false; 30 return false;
30 candidate.plane_z_order = next_z_order--; 31 candidate.plane_z_order = next_z_order--;
31 new_candidates.push_back(candidate); 32 new_candidates.push_back(candidate);
32 } 33 }
33 34
34 capability_checker_->CheckOverlaySupport(&new_candidates); 35 capability_checker_->CheckOverlaySupport(&new_candidates);
35 for (const OverlayCandidate& candidate : new_candidates) { 36 for (const OverlayCandidate& candidate : new_candidates) {
36 if (!candidate.overlay_handled) 37 if (!candidate.overlay_handled)
37 return false; 38 return false;
38 } 39 }
39 40
40 quad_list.clear(); 41 quad_list.clear();
41 candidates->swap(new_candidates); 42 candidates->swap(new_candidates);
42 return true; 43 return true;
43 } 44 }
44 45
45 } // namespace cc 46 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_strategy_all_or_nothing.h ('k') | cc/output/overlay_strategy_sandwich.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698