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

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

Issue 1330563004: Avoid Copying damage rect when using Overlays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove blending checks Created 5 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_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(ResourceProvider* resource_provider, 20 bool OverlayStrategyAllOrNothing::Attempt(ResourceProvider* resource_provider,
21 RenderPassList* render_passes, 21 RenderPassList* render_passes,
22 OverlayCandidateList* candidates) { 22 OverlayCandidateList* candidates,
23 gfx::Rect* damage_rect) {
23 QuadList& quad_list = render_passes->back()->quad_list; 24 QuadList& quad_list = render_passes->back()->quad_list;
24 OverlayCandidateList new_candidates; 25 OverlayCandidateList new_candidates;
25 int next_z_order = -1; 26 int next_z_order = -1;
26 27
27 for (const DrawQuad* quad : quad_list) { 28 for (const DrawQuad* quad : quad_list) {
28 OverlayCandidate candidate; 29 OverlayCandidate candidate;
29 if (!OverlayCandidate::FromDrawQuad(resource_provider, quad, &candidate)) 30 if (!OverlayCandidate::FromDrawQuad(resource_provider, quad, &candidate))
30 return false; 31 return false;
31 candidate.plane_z_order = next_z_order--; 32 candidate.plane_z_order = next_z_order--;
32 new_candidates.push_back(candidate); 33 new_candidates.push_back(candidate);
33 } 34 }
34 35
35 capability_checker_->CheckOverlaySupport(&new_candidates); 36 capability_checker_->CheckOverlaySupport(&new_candidates);
36 for (const OverlayCandidate& candidate : new_candidates) { 37 for (const OverlayCandidate& candidate : new_candidates) {
37 if (!candidate.overlay_handled) 38 if (!candidate.overlay_handled)
38 return false; 39 return false;
39 } 40 }
40 41
41 quad_list.clear(); 42 quad_list.clear();
42 candidates->swap(new_candidates); 43 candidates->swap(new_candidates);
43 return true; 44 return true;
44 } 45 }
45 46
46 } // namespace cc 47 } // 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