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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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 | « cc/output/output_surface_unittest.cc ('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
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 #ifndef CC_OUTPUT_OVERLAY_PROCESSOR_H_ 5 #ifndef CC_OUTPUT_OVERLAY_PROCESSOR_H_
6 #define CC_OUTPUT_OVERLAY_PROCESSOR_H_ 6 #define CC_OUTPUT_OVERLAY_PROCESSOR_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
11 #include "cc/output/ca_layer_overlay.h" 12 #include "cc/output/ca_layer_overlay.h"
12 #include "cc/output/overlay_candidate.h" 13 #include "cc/output/overlay_candidate.h"
13 #include "cc/quads/render_pass.h" 14 #include "cc/quads/render_pass.h"
14 15
15 namespace cc { 16 namespace cc {
16 class OutputSurface; 17 class OutputSurface;
17 class ResourceProvider; 18 class ResourceProvider;
18 19
19 class CC_EXPORT OverlayProcessor { 20 class CC_EXPORT OverlayProcessor {
20 public: 21 public:
21 class CC_EXPORT Strategy { 22 class CC_EXPORT Strategy {
22 public: 23 public:
23 virtual ~Strategy() {} 24 virtual ~Strategy() {}
24 // Returns false if the strategy cannot be made to work with the 25 // Returns false if the strategy cannot be made to work with the
25 // current set of render passes. Returns true if the strategy was successful 26 // current set of render passes. Returns true if the strategy was successful
26 // and adds any additional passes necessary to represent overlays to 27 // and adds any additional passes necessary to represent overlays to
27 // |render_passes|. 28 // |render_passes|.
28 virtual bool Attempt(ResourceProvider* resource_provider, 29 virtual bool Attempt(ResourceProvider* resource_provider,
29 RenderPass* render_pass, 30 RenderPass* render_pass,
30 OverlayCandidateList* candidates) = 0; 31 OverlayCandidateList* candidates) = 0;
31 }; 32 };
32 using StrategyList = std::vector<scoped_ptr<Strategy>>; 33 using StrategyList = std::vector<std::unique_ptr<Strategy>>;
33 34
34 explicit OverlayProcessor(OutputSurface* surface); 35 explicit OverlayProcessor(OutputSurface* surface);
35 virtual ~OverlayProcessor(); 36 virtual ~OverlayProcessor();
36 // Virtual to allow testing different strategies. 37 // Virtual to allow testing different strategies.
37 virtual void Initialize(); 38 virtual void Initialize();
38 39
39 gfx::Rect GetAndResetOverlayDamage(); 40 gfx::Rect GetAndResetOverlayDamage();
40 41
41 // Attempt to replace quads from the specified root render pass with overlays 42 // Attempt to replace quads from the specified root render pass with overlays
42 // or CALayers. This must be called every frame. 43 // or CALayers. This must be called every frame.
(...skipping 18 matching lines...) Expand all
61 // Update |damage_rect| by removing damage casued by |candidates|. 62 // Update |damage_rect| by removing damage casued by |candidates|.
62 void UpdateDamageRect(OverlayCandidateList* candidates, 63 void UpdateDamageRect(OverlayCandidateList* candidates,
63 gfx::Rect* damage_rect); 64 gfx::Rect* damage_rect);
64 65
65 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); 66 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor);
66 }; 67 };
67 68
68 } // namespace cc 69 } // namespace cc
69 70
70 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ 71 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_
OLDNEW
« no previous file with comments | « cc/output/output_surface_unittest.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698