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

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

Issue 2573603005: Compute damage rect for Cast video compositing (Closed)
Patch Set: Created 4 years 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_frame.h ('k') | cc/output/overlay_processor.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> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 11 matching lines...) Expand all
22 class CC_EXPORT Strategy { 22 class CC_EXPORT Strategy {
23 public: 23 public:
24 virtual ~Strategy() {} 24 virtual ~Strategy() {}
25 // 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
26 // 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
27 // and adds any additional passes necessary to represent overlays to 27 // and adds any additional passes necessary to represent overlays to
28 // |render_passes|. 28 // |render_passes|.
29 virtual bool Attempt(ResourceProvider* resource_provider, 29 virtual bool Attempt(ResourceProvider* resource_provider,
30 RenderPass* render_pass, 30 RenderPass* render_pass,
31 OverlayCandidateList* candidates) = 0; 31 OverlayCandidateList* candidates) = 0;
32
33 virtual bool GetSwapWithDamageRect(gfx::Rect* rect);
32 }; 34 };
33 using StrategyList = std::vector<std::unique_ptr<Strategy>>; 35 using StrategyList = std::vector<std::unique_ptr<Strategy>>;
34 36
35 explicit OverlayProcessor(OutputSurface* surface); 37 explicit OverlayProcessor(OutputSurface* surface);
36 virtual ~OverlayProcessor(); 38 virtual ~OverlayProcessor();
37 // Virtual to allow testing different strategies. 39 // Virtual to allow testing different strategies.
38 virtual void Initialize(); 40 virtual void Initialize();
39 41
40 gfx::Rect GetAndResetOverlayDamage(); 42 gfx::Rect GetAndResetOverlayDamage();
41 43
42 // Attempt to replace quads from the specified root render pass with overlays 44 // Attempt to replace quads from the specified root render pass with overlays
43 // or CALayers. This must be called every frame. 45 // or CALayers. This must be called every frame.
44 void ProcessForOverlays(ResourceProvider* resource_provider, 46 void ProcessForOverlays(ResourceProvider* resource_provider,
45 RenderPass* root_render_pass, 47 RenderPass* root_render_pass,
46 OverlayCandidateList* overlay_candidates, 48 OverlayCandidateList* overlay_candidates,
47 CALayerOverlayList* ca_layer_overlays, 49 CALayerOverlayList* ca_layer_overlays,
48 gfx::Rect* damage_rect); 50 gfx::Rect* damage_rect);
49 51
52 bool GetSwapWithDamageRect(gfx::Rect* damage_rect);
53
50 protected: 54 protected:
51 StrategyList strategies_; 55 StrategyList strategies_;
52 OutputSurface* surface_; 56 OutputSurface* surface_;
53 gfx::Rect overlay_damage_rect_; 57 gfx::Rect overlay_damage_rect_;
54 gfx::Rect previous_frame_underlay_rect_; 58 gfx::Rect previous_frame_underlay_rect_;
55 59
60 bool have_swap_with_damage_rect_;
61 gfx::Rect swap_with_damage_rect_;
62
56 private: 63 private:
57 bool ProcessForCALayers(ResourceProvider* resource_provider, 64 bool ProcessForCALayers(ResourceProvider* resource_provider,
58 RenderPass* render_pass, 65 RenderPass* render_pass,
59 OverlayCandidateList* overlay_candidates, 66 OverlayCandidateList* overlay_candidates,
60 CALayerOverlayList* ca_layer_overlays, 67 CALayerOverlayList* ca_layer_overlays,
61 gfx::Rect* damage_rect); 68 gfx::Rect* damage_rect);
62 // Update |damage_rect| by removing damage casued by |candidates|. 69 // Update |damage_rect| by removing damage casued by |candidates|.
63 void UpdateDamageRect(OverlayCandidateList* candidates, 70 void UpdateDamageRect(OverlayCandidateList* candidates,
64 gfx::Rect* damage_rect); 71 gfx::Rect* damage_rect);
65 72
66 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor); 73 DISALLOW_COPY_AND_ASSIGN(OverlayProcessor);
67 }; 74 };
68 75
69 } // namespace cc 76 } // namespace cc
70 77
71 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_ 78 #endif // CC_OUTPUT_OVERLAY_PROCESSOR_H_
OLDNEW
« no previous file with comments | « cc/output/output_surface_frame.h ('k') | cc/output/overlay_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698