OLD | NEW |
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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 virtual ~Strategy() {} | 22 virtual ~Strategy() {} |
23 // Returns false if the strategy cannot be made to work with the | 23 // Returns false if the strategy cannot be made to work with the |
24 // current set of render passes. Returns true if the strategy was successful | 24 // current set of render passes. Returns true if the strategy was successful |
25 // and adds any additional passes necessary to represent overlays to | 25 // and adds any additional passes necessary to represent overlays to |
26 // |render_passes_in_draw_order|. | 26 // |render_passes_in_draw_order|. |
27 virtual bool Attempt(RenderPassList* render_passes_in_draw_order, | 27 virtual bool Attempt(RenderPassList* render_passes_in_draw_order, |
28 OverlayCandidateList* candidates) = 0; | 28 OverlayCandidateList* candidates) = 0; |
29 }; | 29 }; |
30 typedef ScopedPtrVector<Strategy> StrategyList; | 30 typedef ScopedPtrVector<Strategy> StrategyList; |
31 | 31 |
32 OverlayProcessor(OutputSurface* surface, ResourceProvider* resource_provider); | 32 OverlayProcessor(OutputSurface* surface); |
33 virtual ~OverlayProcessor(); | 33 virtual ~OverlayProcessor(); |
34 // Virtual to allow testing different strategies. | 34 // Virtual to allow testing different strategies. |
35 virtual void Initialize(); | 35 virtual void Initialize(); |
36 | 36 |
37 void ProcessForOverlays(RenderPassList* render_passes_in_draw_order, | 37 void ProcessForOverlays(RenderPassList* render_passes_in_draw_order, |
38 OverlayCandidateList* candidate_list); | 38 OverlayCandidateList* candidate_list); |
39 | 39 |
40 protected: | 40 protected: |
41 StrategyList strategies_; | 41 StrategyList strategies_; |
42 OutputSurface* surface_; | 42 OutputSurface* surface_; |
43 ResourceProvider* resource_provider_; | |
44 | 43 |
45 private: | 44 private: |
46 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); | 45 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); |
47 }; | 46 }; |
48 | 47 |
49 } // namespace cc | 48 } // namespace cc |
50 | 49 |
51 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ | 50 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ |
OLD | NEW |