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

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

Issue 1430813002: cc: Fork OverlayCandidate to CALayerOverlay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master1
Patch Set: Rebase 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_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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/output/overlay_strategy_all_or_nothing.h"
6
7 #include "cc/output/overlay_candidate_validator.h"
8 #include "cc/quads/draw_quad.h"
9
10 namespace cc {
11
12 OverlayStrategyAllOrNothing::OverlayStrategyAllOrNothing(
13 OverlayCandidateValidator* capability_checker)
14 : capability_checker_(capability_checker) {
15 DCHECK(capability_checker);
16 }
17
18 OverlayStrategyAllOrNothing::~OverlayStrategyAllOrNothing() {}
19
20 bool OverlayStrategyAllOrNothing::Attempt(ResourceProvider* resource_provider,
21 RenderPassList* render_passes,
22 OverlayCandidateList* candidates,
23 gfx::Rect* damage_rect) {
24 QuadList& quad_list = render_passes->back()->quad_list;
25 OverlayCandidateList new_candidates;
26 int next_z_order = -1;
27
28 for (const DrawQuad* quad : quad_list) {
29 OverlayCandidate candidate;
30 if (!OverlayCandidate::FromDrawQuad(resource_provider, quad, &candidate))
31 return false;
32 candidate.plane_z_order = next_z_order--;
33 new_candidates.push_back(candidate);
34 }
35
36 capability_checker_->CheckOverlaySupport(&new_candidates);
37 for (const OverlayCandidate& candidate : new_candidates) {
38 if (!candidate.overlay_handled)
39 return false;
40 }
41
42 quad_list.clear();
43 candidates->swap(new_candidates);
44 return true;
45 }
46
47 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_strategy_all_or_nothing.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698