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

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

Issue 2304483002: Revert of Make cc::Display not own its BeginFrameSource (Closed)
Patch Set: Created 4 years, 3 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 | « blimp/client/app/compositor/browser_compositor.cc ('k') | cc/surfaces/display.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_DISPLAY_H_ 5 #ifndef CC_SURFACES_DISPLAY_H_
6 #define CC_SURFACES_DISPLAY_H_ 6 #define CC_SURFACES_DISPLAY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // surface IDs used to draw into the display and deciding when to draw. 50 // surface IDs used to draw into the display and deciding when to draw.
51 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, 51 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
52 public OutputSurfaceClient, 52 public OutputSurfaceClient,
53 public SurfaceDamageObserver { 53 public SurfaceDamageObserver {
54 public: 54 public:
55 // The |begin_frame_source| and |scheduler| may be null (together). In that 55 // The |begin_frame_source| and |scheduler| may be null (together). In that
56 // case, DrawAndSwap must be called externally when needed. 56 // case, DrawAndSwap must be called externally when needed.
57 Display(SharedBitmapManager* bitmap_manager, 57 Display(SharedBitmapManager* bitmap_manager,
58 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 58 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
59 const RendererSettings& settings, 59 const RendererSettings& settings,
60 BeginFrameSource* begin_frame_source, 60 std::unique_ptr<BeginFrameSource> begin_frame_source,
61 std::unique_ptr<OutputSurface> output_surface, 61 std::unique_ptr<OutputSurface> output_surface,
62 std::unique_ptr<DisplayScheduler> scheduler, 62 std::unique_ptr<DisplayScheduler> scheduler,
63 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); 63 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter);
64 64
65 ~Display() override; 65 ~Display() override;
66 66
67 void Initialize(DisplayClient* client, 67 void Initialize(DisplayClient* client,
68 SurfaceManager* surface_manager, 68 SurfaceManager* surface_manager,
69 uint32_t compositor_surface_namespace); 69 uint32_t compositor_surface_namespace);
70 70
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 void ForceImmediateDrawAndSwapIfPossible(); 111 void ForceImmediateDrawAndSwapIfPossible();
112 112
113 private: 113 private:
114 void InitializeRenderer(); 114 void InitializeRenderer();
115 void UpdateRootSurfaceResourcesLocked(); 115 void UpdateRootSurfaceResourcesLocked();
116 116
117 SharedBitmapManager* const bitmap_manager_; 117 SharedBitmapManager* const bitmap_manager_;
118 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; 118 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_;
119 const RendererSettings settings_; 119 const RendererSettings settings_;
120 BeginFrameSource* const begin_frame_source_;
121 120
122 DisplayClient* client_ = nullptr; 121 DisplayClient* client_ = nullptr;
123 SurfaceManager* surface_manager_ = nullptr; 122 SurfaceManager* surface_manager_ = nullptr;
124 uint32_t compositor_surface_namespace_; 123 uint32_t compositor_surface_namespace_;
125 SurfaceId current_surface_id_; 124 SurfaceId current_surface_id_;
126 gfx::Size current_surface_size_; 125 gfx::Size current_surface_size_;
127 float device_scale_factor_ = 1.f; 126 float device_scale_factor_ = 1.f;
128 gfx::ColorSpace device_color_space_; 127 gfx::ColorSpace device_color_space_;
129 bool visible_ = false; 128 bool visible_ = false;
130 bool swapped_since_resize_ = false; 129 bool swapped_since_resize_ = false;
131 gfx::Rect external_clip_; 130 gfx::Rect external_clip_;
132 gfx::Rect external_viewport_; 131 gfx::Rect external_viewport_;
133 bool output_is_secure_ = false; 132 bool output_is_secure_ = false;
134 133
134 // The begin_frame_source_ is often known by the output_surface_ and
135 // the scheduler_.
136 std::unique_ptr<BeginFrameSource> begin_frame_source_;
135 std::unique_ptr<OutputSurface> output_surface_; 137 std::unique_ptr<OutputSurface> output_surface_;
136 std::unique_ptr<DisplayScheduler> scheduler_; 138 std::unique_ptr<DisplayScheduler> scheduler_;
137 std::unique_ptr<ResourceProvider> resource_provider_; 139 std::unique_ptr<ResourceProvider> resource_provider_;
138 std::unique_ptr<SurfaceAggregator> aggregator_; 140 std::unique_ptr<SurfaceAggregator> aggregator_;
139 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; 141 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
140 std::unique_ptr<DirectRenderer> renderer_; 142 std::unique_ptr<DirectRenderer> renderer_;
141 SoftwareRenderer* software_renderer_ = nullptr; 143 SoftwareRenderer* software_renderer_ = nullptr;
142 std::vector<ui::LatencyInfo> stored_latency_info_; 144 std::vector<ui::LatencyInfo> stored_latency_info_;
143 145
144 private: 146 private:
145 DISALLOW_COPY_AND_ASSIGN(Display); 147 DISALLOW_COPY_AND_ASSIGN(Display);
146 }; 148 };
147 149
148 } // namespace cc 150 } // namespace cc
149 151
150 #endif // CC_SURFACES_DISPLAY_H_ 152 #endif // CC_SURFACES_DISPLAY_H_
OLDNEW
« no previous file with comments | « blimp/client/app/compositor/browser_compositor.cc ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698