| 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 14 matching lines...) Expand all Loading... |
| 25 // current set of render passes. Returns true if the strategy was successful | 25 // current set of render passes. Returns true if the strategy was successful |
| 26 // and adds any additional passes necessary to represent overlays to | 26 // and adds any additional passes necessary to represent overlays to |
| 27 // |render_passes|. Strategy can also optimize |damage_rect| as it seems | 27 // |render_passes|. Strategy can also optimize |damage_rect| as it seems |
| 28 // fit to reduce GL composition, in case |damage_rect| is obscured by | 28 // fit to reduce GL composition, in case |damage_rect| is obscured by |
| 29 // overlays. | 29 // overlays. |
| 30 virtual bool Attempt(ResourceProvider* resource_provider, | 30 virtual bool Attempt(ResourceProvider* resource_provider, |
| 31 RenderPassList* render_passes, | 31 RenderPassList* render_passes, |
| 32 OverlayCandidateList* candidates, | 32 OverlayCandidateList* candidates, |
| 33 gfx::Rect* damage_rect) = 0; | 33 gfx::Rect* damage_rect) = 0; |
| 34 }; | 34 }; |
| 35 typedef ScopedPtrVector<Strategy> StrategyList; | 35 using StrategyList = std::vector<scoped_ptr<Strategy>>; |
| 36 | 36 |
| 37 explicit OverlayProcessor(OutputSurface* surface); | 37 explicit OverlayProcessor(OutputSurface* surface); |
| 38 virtual ~OverlayProcessor(); | 38 virtual ~OverlayProcessor(); |
| 39 // Virtual to allow testing different strategies. | 39 // Virtual to allow testing different strategies. |
| 40 virtual void Initialize(); | 40 virtual void Initialize(); |
| 41 | 41 |
| 42 bool ProcessForCALayers(ResourceProvider* resource_provider, | 42 bool ProcessForCALayers(ResourceProvider* resource_provider, |
| 43 RenderPassList* render_passes, | 43 RenderPassList* render_passes, |
| 44 CALayerOverlayList* ca_layer_overlays, | 44 CALayerOverlayList* ca_layer_overlays, |
| 45 OverlayCandidateList* overlay_candidates); | 45 OverlayCandidateList* overlay_candidates); |
| 46 | 46 |
| 47 void ProcessForOverlays(ResourceProvider* resource_provider, | 47 void ProcessForOverlays(ResourceProvider* resource_provider, |
| 48 RenderPassList* render_passes, | 48 RenderPassList* render_passes, |
| 49 OverlayCandidateList* candidates, | 49 OverlayCandidateList* candidates, |
| 50 gfx::Rect* damage_rect); | 50 gfx::Rect* damage_rect); |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 StrategyList strategies_; | 53 StrategyList strategies_; |
| 54 OutputSurface* surface_; | 54 OutputSurface* surface_; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); | 57 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace cc | 60 } // namespace cc |
| 61 | 61 |
| 62 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ | 62 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ |
| OLD | NEW |