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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 explicit OverlayProcessor(OutputSurface* surface); | 35 explicit OverlayProcessor(OutputSurface* surface); |
36 virtual ~OverlayProcessor(); | 36 virtual ~OverlayProcessor(); |
37 // Virtual to allow testing different strategies. | 37 // Virtual to allow testing different strategies. |
38 virtual void Initialize(); | 38 virtual void Initialize(); |
39 | 39 |
40 gfx::Rect GetAndResetOverlayDamage(); | 40 gfx::Rect GetAndResetOverlayDamage(); |
41 | 41 |
42 // 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 |
43 // or CALayers. This must be called every frame. | 43 // or CALayers. This must be called every frame. |
44 void ProcessForOverlays(ResourceProvider* resource_provider, | 44 void ProcessForOverlays( |
45 RenderPass* root_render_pass, | 45 ResourceProvider* resource_provider, |
46 OverlayCandidateList* overlay_candidates, | 46 RenderPass* root_render_pass, |
47 CALayerOverlayList* ca_layer_overlays, | 47 const RenderPassFilterList& render_pass_filters, |
48 gfx::Rect* damage_rect); | 48 const RenderPassFilterList& render_pass_background_filters, |
| 49 OverlayCandidateList* overlay_candidates, |
| 50 CALayerOverlayList* ca_layer_overlays, |
| 51 gfx::Rect* damage_rect); |
49 | 52 |
50 protected: | 53 protected: |
51 StrategyList strategies_; | 54 StrategyList strategies_; |
52 OutputSurface* surface_; | 55 OutputSurface* surface_; |
53 gfx::Rect overlay_damage_rect_; | 56 gfx::Rect overlay_damage_rect_; |
54 gfx::Rect previous_frame_underlay_rect_; | 57 gfx::Rect previous_frame_underlay_rect_; |
55 | 58 |
56 private: | 59 private: |
57 bool ProcessForCALayers(ResourceProvider* resource_provider, | 60 bool ProcessForCALayers( |
58 RenderPass* render_pass, | 61 ResourceProvider* resource_provider, |
59 OverlayCandidateList* overlay_candidates, | 62 RenderPass* render_pass, |
60 CALayerOverlayList* ca_layer_overlays, | 63 const RenderPassFilterList& render_pass_filters, |
61 gfx::Rect* damage_rect); | 64 const RenderPassFilterList& render_pass_background_filters, |
| 65 OverlayCandidateList* overlay_candidates, |
| 66 CALayerOverlayList* ca_layer_overlays, |
| 67 gfx::Rect* damage_rect); |
62 // Update |damage_rect| by removing damage casued by |candidates|. | 68 // Update |damage_rect| by removing damage casued by |candidates|. |
63 void UpdateDamageRect(OverlayCandidateList* candidates, | 69 void UpdateDamageRect(OverlayCandidateList* candidates, |
64 gfx::Rect* damage_rect); | 70 gfx::Rect* damage_rect); |
65 | 71 |
66 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); | 72 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); |
67 }; | 73 }; |
68 | 74 |
69 } // namespace cc | 75 } // namespace cc |
70 | 76 |
71 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ | 77 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ |
OLD | NEW |