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

Side by Side Diff: cc/surfaces/surface_aggregator.h

Issue 1673783004: Hook up BeginFrameSource to SurfaceFactoryClient via SurfaceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Register id namespace on Android Created 4 years, 9 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/surfaces/surface.cc ('k') | cc/surfaces/surface_aggregator.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_SURFACES_SURFACE_AGGREGATOR_H_ 5 #ifndef CC_SURFACES_SURFACE_AGGREGATOR_H_
6 #define CC_SURFACES_SURFACE_AGGREGATOR_H_ 6 #define CC_SURFACES_SURFACE_AGGREGATOR_H_
7 7
8 #include <set> 8 #include <set>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <unordered_set> 10 #include <unordered_set>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "cc/quads/draw_quad.h" 15 #include "cc/quads/draw_quad.h"
16 #include "cc/quads/render_pass.h" 16 #include "cc/quads/render_pass.h"
17 #include "cc/resources/transferable_resource.h" 17 #include "cc/resources/transferable_resource.h"
18 #include "cc/surfaces/surface_id.h" 18 #include "cc/surfaces/surface_id.h"
19 #include "cc/surfaces/surfaces_export.h" 19 #include "cc/surfaces/surfaces_export.h"
20 20
21 namespace cc { 21 namespace cc {
22 22
23 class CompositorFrame; 23 class CompositorFrame;
24 class DelegatedFrameData; 24 class DelegatedFrameData;
25 class ResourceProvider; 25 class ResourceProvider;
26 class Surface; 26 class Surface;
27 class SurfaceDrawQuad; 27 class SurfaceDrawQuad;
28 class SurfaceManager; 28 class SurfaceManager;
29 29
30 class CC_SURFACES_EXPORT SurfaceAggregatorClient {
31 public:
32 virtual ~SurfaceAggregatorClient() {}
33
34 virtual void AddSurface(Surface* surface) = 0;
35 virtual void RemoveSurface(Surface* surface) = 0;
36 };
37
38 class CC_SURFACES_EXPORT SurfaceAggregator { 30 class CC_SURFACES_EXPORT SurfaceAggregator {
39 public: 31 public:
40 using SurfaceIndexMap = std::unordered_map<SurfaceId, int, SurfaceIdHash>; 32 using SurfaceIndexMap = std::unordered_map<SurfaceId, int, SurfaceIdHash>;
41 33
42 SurfaceAggregator(SurfaceAggregatorClient* client, 34 SurfaceAggregator(SurfaceManager* manager,
43 SurfaceManager* manager,
44 ResourceProvider* provider, 35 ResourceProvider* provider,
45 bool aggregate_only_damaged); 36 bool aggregate_only_damaged);
46 ~SurfaceAggregator(); 37 ~SurfaceAggregator();
47 38
48 scoped_ptr<CompositorFrame> Aggregate(SurfaceId surface_id); 39 scoped_ptr<CompositorFrame> Aggregate(SurfaceId surface_id);
49 void ReleaseResources(SurfaceId surface_id); 40 void ReleaseResources(SurfaceId surface_id);
50 SurfaceIndexMap& previous_contained_surfaces() { 41 SurfaceIndexMap& previous_contained_surfaces() {
51 return previous_contained_surfaces_; 42 return previous_contained_surfaces_;
52 } 43 }
53 void SetFullDamageForSurface(SurfaceId surface_id); 44 void SetFullDamageForSurface(SurfaceId surface_id);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // referenced from the ResourceProvider. 93 // referenced from the ResourceProvider.
103 // Also notifies SurfaceAggregatorClient of newly added and removed 94 // Also notifies SurfaceAggregatorClient of newly added and removed
104 // child surfaces. 95 // child surfaces.
105 void ProcessAddedAndRemovedSurfaces(); 96 void ProcessAddedAndRemovedSurfaces();
106 97
107 int ChildIdForSurface(Surface* surface); 98 int ChildIdForSurface(Surface* surface);
108 gfx::Rect DamageRectForSurface(const Surface* surface, 99 gfx::Rect DamageRectForSurface(const Surface* surface,
109 const RenderPass& source, 100 const RenderPass& source,
110 const gfx::Rect& full_rect) const; 101 const gfx::Rect& full_rect) const;
111 102
112 SurfaceAggregatorClient* client_; // Outlives this class.
113 SurfaceManager* manager_; 103 SurfaceManager* manager_;
114 ResourceProvider* provider_; 104 ResourceProvider* provider_;
115 105
116 class RenderPassIdAllocator; 106 class RenderPassIdAllocator;
117 using RenderPassIdAllocatorMap = 107 using RenderPassIdAllocatorMap =
118 std::unordered_map<SurfaceId, 108 std::unordered_map<SurfaceId,
119 scoped_ptr<RenderPassIdAllocator>, 109 scoped_ptr<RenderPassIdAllocator>,
120 SurfaceIdHash>; 110 SurfaceIdHash>;
121 RenderPassIdAllocatorMap render_pass_allocator_map_; 111 RenderPassIdAllocatorMap render_pass_allocator_map_;
122 int next_render_pass_id_; 112 int next_render_pass_id_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 TransferableResourceArray* dest_resource_list_; 147 TransferableResourceArray* dest_resource_list_;
158 148
159 base::WeakPtrFactory<SurfaceAggregator> weak_factory_; 149 base::WeakPtrFactory<SurfaceAggregator> weak_factory_;
160 150
161 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator); 151 DISALLOW_COPY_AND_ASSIGN(SurfaceAggregator);
162 }; 152 };
163 153
164 } // namespace cc 154 } // namespace cc
165 155
166 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_ 156 #endif // CC_SURFACES_SURFACE_AGGREGATOR_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface.cc ('k') | cc/surfaces/surface_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698