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

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

Issue 1136153002: Enable underlay strategy by default in OverlayProcessor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_processor.h" 5 #include "cc/output/overlay_processor.h"
6 6
7 #include "cc/output/output_surface.h" 7 #include "cc/output/output_surface.h"
8 #include "cc/output/overlay_strategy_single_on_top.h" 8 #include "cc/output/overlay_strategy_single_on_top.h"
9 #include "cc/output/overlay_strategy_underlay.h"
9 #include "ui/gfx/geometry/rect_conversions.h" 10 #include "ui/gfx/geometry/rect_conversions.h"
10 #include "ui/gfx/transform.h" 11 #include "ui/gfx/transform.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 OverlayProcessor::OverlayProcessor(OutputSurface* surface, 15 OverlayProcessor::OverlayProcessor(OutputSurface* surface,
15 ResourceProvider* resource_provider) 16 ResourceProvider* resource_provider)
16 : surface_(surface), resource_provider_(resource_provider) {} 17 : surface_(surface), resource_provider_(resource_provider) {}
17 18
18 void OverlayProcessor::Initialize() { 19 void OverlayProcessor::Initialize() {
19 DCHECK(surface_); 20 DCHECK(surface_);
20 if (!resource_provider_) 21 if (!resource_provider_)
21 return; 22 return;
22 23
23 OverlayCandidateValidator* candidates = 24 OverlayCandidateValidator* candidates =
24 surface_->GetOverlayCandidateValidator(); 25 surface_->GetOverlayCandidateValidator();
25 if (candidates) { 26 if (candidates) {
26 strategies_.push_back(scoped_ptr<Strategy>( 27 strategies_.push_back(scoped_ptr<Strategy>(
27 new OverlayStrategySingleOnTop(candidates, resource_provider_))); 28 new OverlayStrategySingleOnTop(candidates, resource_provider_)));
29 strategies_.push_back(scoped_ptr<Strategy>(
30 new OverlayStrategyUnderlay(candidates, resource_provider_)));
28 } 31 }
29 } 32 }
30 33
31 OverlayProcessor::~OverlayProcessor() {} 34 OverlayProcessor::~OverlayProcessor() {}
32 35
33 void OverlayProcessor::ProcessForOverlays( 36 void OverlayProcessor::ProcessForOverlays(
34 RenderPassList* render_passes_in_draw_order, 37 RenderPassList* render_passes_in_draw_order,
35 OverlayCandidateList* candidate_list) { 38 OverlayCandidateList* candidate_list) {
36 for (StrategyList::iterator it = strategies_.begin(); it != strategies_.end(); 39 for (StrategyList::iterator it = strategies_.begin(); it != strategies_.end();
37 ++it) { 40 ++it) {
38 if ((*it)->Attempt(render_passes_in_draw_order, candidate_list)) 41 if ((*it)->Attempt(render_passes_in_draw_order, candidate_list))
39 return; 42 return;
40 } 43 }
41 } 44 }
42 45
43 } // namespace cc 46 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698