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

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

Issue 1380653003: Mac Overlays: Allow SolidColor and Tile quads to be candidates for overlays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AllOrNothing2
Patch Set: Plumb allow_overlay 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
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_sandwich.h" 5 #include "cc/output/overlay_strategy_sandwich.h"
6 6
7 #include "cc/base/math_util.h" 7 #include "cc/base/math_util.h"
8 #include "cc/base/region.h" 8 #include "cc/base/region.h"
9 #include "cc/output/overlay_candidate_validator.h" 9 #include "cc/output/overlay_candidate_validator.h"
10 #include "cc/quads/draw_quad.h" 10 #include "cc/quads/draw_quad.h"
(...skipping 27 matching lines...) Expand all
38 DCHECK(capability_checker); 38 DCHECK(capability_checker);
39 } 39 }
40 40
41 OverlayStrategySandwich::~OverlayStrategySandwich() {} 41 OverlayStrategySandwich::~OverlayStrategySandwich() {}
42 42
43 bool OverlayStrategySandwich::Attempt(RenderPassList* render_passes, 43 bool OverlayStrategySandwich::Attempt(RenderPassList* render_passes,
44 OverlayCandidateList* candidate_list) { 44 OverlayCandidateList* candidate_list) {
45 QuadList& quad_list = render_passes->back()->quad_list; 45 QuadList& quad_list = render_passes->back()->quad_list;
46 for (auto it = quad_list.begin(); it != quad_list.end();) { 46 for (auto it = quad_list.begin(); it != quad_list.end();) {
47 OverlayCandidate candidate; 47 OverlayCandidate candidate;
48 if (OverlayCandidate::FromDrawQuad(*it, &candidate)) 48 if (OverlayCandidate::IsVideoQuad(*it) &&
49 OverlayCandidate::FromDrawQuad(*it, &candidate)) {
49 it = TryOverlay(render_passes->back(), candidate_list, candidate, it); 50 it = TryOverlay(render_passes->back(), candidate_list, candidate, it);
50 else 51 } else {
51 ++it; 52 ++it;
53 }
52 } 54 }
53 55
54 return candidate_list->size() > 1; 56 return candidate_list->size() > 1;
55 } 57 }
56 58
57 QuadList::Iterator OverlayStrategySandwich::TryOverlay( 59 QuadList::Iterator OverlayStrategySandwich::TryOverlay(
58 RenderPass* render_pass, 60 RenderPass* render_pass,
59 OverlayCandidateList* candidate_list, 61 OverlayCandidateList* candidate_list,
60 const OverlayCandidate& candidate, 62 const OverlayCandidate& candidate,
61 QuadList::Iterator candidate_iter_in_quad_list) { 63 QuadList::Iterator candidate_iter_in_quad_list) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 SK_ColorTRANSPARENT, true); 173 SK_ColorTRANSPARENT, true);
172 ++candidate_iter_in_quad_list; 174 ++candidate_iter_in_quad_list;
173 } 175 }
174 } 176 }
175 177
176 candidate_list->swap(new_candidate_list); 178 candidate_list->swap(new_candidate_list);
177 return candidate_iter_in_quad_list; 179 return candidate_iter_in_quad_list;
178 } 180 }
179 181
180 } // namespace cc 182 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698