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

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

Issue 1142343008: cc: Rework overlays to not use the ResourceProvider and pass texture size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more tests Created 5 years, 6 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 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 "cc/output/overlay_strategy_underlay.h"
10 #include "ui/gfx/geometry/rect_conversions.h" 10 #include "ui/gfx/geometry/rect_conversions.h"
11 #include "ui/gfx/transform.h" 11 #include "ui/gfx/transform.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 OverlayProcessor::OverlayProcessor(OutputSurface* surface, 15 OverlayProcessor::OverlayProcessor(OutputSurface* surface) : surface_(surface) {
16 ResourceProvider* resource_provider) 16 }
17 : surface_(surface), resource_provider_(resource_provider) {}
18 17
19 void OverlayProcessor::Initialize() { 18 void OverlayProcessor::Initialize() {
20 DCHECK(surface_); 19 DCHECK(surface_);
21 if (!resource_provider_)
22 return;
23 20
24 OverlayCandidateValidator* candidates = 21 OverlayCandidateValidator* candidates =
25 surface_->GetOverlayCandidateValidator(); 22 surface_->GetOverlayCandidateValidator();
26 if (candidates) { 23 if (candidates) {
27 strategies_.push_back(scoped_ptr<Strategy>( 24 strategies_.push_back(
28 new OverlayStrategySingleOnTop(candidates, resource_provider_))); 25 scoped_ptr<Strategy>(new OverlayStrategySingleOnTop(candidates)));
29 strategies_.push_back(scoped_ptr<Strategy>( 26 strategies_.push_back(
30 new OverlayStrategyUnderlay(candidates, resource_provider_))); 27 scoped_ptr<Strategy>(new OverlayStrategyUnderlay(candidates)));
31 } 28 }
32 } 29 }
33 30
34 OverlayProcessor::~OverlayProcessor() {} 31 OverlayProcessor::~OverlayProcessor() {}
35 32
36 void OverlayProcessor::ProcessForOverlays( 33 void OverlayProcessor::ProcessForOverlays(
37 RenderPassList* render_passes_in_draw_order, 34 RenderPassList* render_passes_in_draw_order,
38 OverlayCandidateList* candidate_list) { 35 OverlayCandidateList* candidate_list) {
39 for (StrategyList::iterator it = strategies_.begin(); it != strategies_.end(); 36 for (StrategyList::iterator it = strategies_.begin(); it != strategies_.end();
40 ++it) { 37 ++it) {
41 if ((*it)->Attempt(render_passes_in_draw_order, candidate_list)) 38 if ((*it)->Attempt(render_passes_in_draw_order, candidate_list))
42 return; 39 return;
43 } 40 }
44 } 41 }
45 42
46 } // namespace cc 43 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698