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

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

Issue 2286273003: Make cc::Display not own its BeginFrameSource (Closed)
Patch Set: Fix webview 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 std::unique_ptr<BeginFrameSource> begin_frame_source, 60 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_;
120 121
121 DisplayClient* client_ = nullptr; 122 DisplayClient* client_ = nullptr;
122 SurfaceManager* surface_manager_ = nullptr; 123 SurfaceManager* surface_manager_ = nullptr;
123 uint32_t compositor_surface_namespace_; 124 uint32_t compositor_surface_namespace_;
124 SurfaceId current_surface_id_; 125 SurfaceId current_surface_id_;
125 gfx::Size current_surface_size_; 126 gfx::Size current_surface_size_;
126 float device_scale_factor_ = 1.f; 127 float device_scale_factor_ = 1.f;
127 gfx::ColorSpace device_color_space_; 128 gfx::ColorSpace device_color_space_;
128 bool visible_ = false; 129 bool visible_ = false;
129 bool swapped_since_resize_ = false; 130 bool swapped_since_resize_ = false;
130 gfx::Rect external_clip_; 131 gfx::Rect external_clip_;
131 gfx::Rect external_viewport_; 132 gfx::Rect external_viewport_;
132 bool output_is_secure_ = false; 133 bool output_is_secure_ = false;
133 134
134 // The begin_frame_source_ is often known by the output_surface_ and
135 // the scheduler_.
136 std::unique_ptr<BeginFrameSource> begin_frame_source_;
137 std::unique_ptr<OutputSurface> output_surface_; 135 std::unique_ptr<OutputSurface> output_surface_;
138 std::unique_ptr<DisplayScheduler> scheduler_; 136 std::unique_ptr<DisplayScheduler> scheduler_;
139 std::unique_ptr<ResourceProvider> resource_provider_; 137 std::unique_ptr<ResourceProvider> resource_provider_;
140 std::unique_ptr<SurfaceAggregator> aggregator_; 138 std::unique_ptr<SurfaceAggregator> aggregator_;
141 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; 139 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
142 std::unique_ptr<DirectRenderer> renderer_; 140 std::unique_ptr<DirectRenderer> renderer_;
143 SoftwareRenderer* software_renderer_ = nullptr; 141 SoftwareRenderer* software_renderer_ = nullptr;
144 std::vector<ui::LatencyInfo> stored_latency_info_; 142 std::vector<ui::LatencyInfo> stored_latency_info_;
145 143
146 private: 144 private:
147 DISALLOW_COPY_AND_ASSIGN(Display); 145 DISALLOW_COPY_AND_ASSIGN(Display);
148 }; 146 };
149 147
150 } // namespace cc 148 } // namespace cc
151 149
152 #endif // CC_SURFACES_DISPLAY_H_ 150 #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