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_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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, | 49 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, |
50 public OutputSurfaceClient, | 50 public OutputSurfaceClient, |
51 public SurfaceObserver { | 51 public SurfaceObserver { |
52 public: | 52 public: |
53 // The |begin_frame_source| and |scheduler| may be null (together). In that | 53 // The |begin_frame_source| and |scheduler| may be null (together). In that |
54 // case, DrawAndSwap must be called externally when needed. | 54 // case, DrawAndSwap must be called externally when needed. |
55 Display(SharedBitmapManager* bitmap_manager, | 55 Display(SharedBitmapManager* bitmap_manager, |
56 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 56 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
57 const RendererSettings& settings, | 57 const RendererSettings& settings, |
58 const FrameSinkId& frame_sink_id, | 58 const FrameSinkId& frame_sink_id, |
59 std::unique_ptr<BeginFrameSource> begin_frame_source, | 59 BeginFrameSource* begin_frame_source, |
60 std::unique_ptr<OutputSurface> output_surface, | 60 std::unique_ptr<OutputSurface> output_surface, |
61 std::unique_ptr<DisplayScheduler> scheduler, | 61 std::unique_ptr<DisplayScheduler> scheduler, |
62 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); | 62 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); |
63 | 63 |
64 ~Display() override; | 64 ~Display() override; |
65 | 65 |
66 void Initialize(DisplayClient* client, SurfaceManager* surface_manager); | 66 void Initialize(DisplayClient* client, SurfaceManager* surface_manager); |
67 | 67 |
68 // device_scale_factor is used to communicate to the external window system | 68 // device_scale_factor is used to communicate to the external window system |
69 // what scale this was rendered at. | 69 // what scale this was rendered at. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 SurfaceManager* surface_manager_ = nullptr; | 108 SurfaceManager* surface_manager_ = nullptr; |
109 const FrameSinkId frame_sink_id_; | 109 const FrameSinkId frame_sink_id_; |
110 SurfaceId current_surface_id_; | 110 SurfaceId current_surface_id_; |
111 gfx::Size current_surface_size_; | 111 gfx::Size current_surface_size_; |
112 float device_scale_factor_ = 1.f; | 112 float device_scale_factor_ = 1.f; |
113 gfx::ColorSpace device_color_space_; | 113 gfx::ColorSpace device_color_space_; |
114 bool visible_ = false; | 114 bool visible_ = false; |
115 bool swapped_since_resize_ = false; | 115 bool swapped_since_resize_ = false; |
116 bool output_is_secure_ = false; | 116 bool output_is_secure_ = false; |
117 | 117 |
118 // The begin_frame_source_ is often known by the output_surface_ and | 118 // The begin_frame_source_ is not owned here, and also often known by the |
119 // the scheduler_. | 119 // output_surface_ and the scheduler_. |
120 std::unique_ptr<BeginFrameSource> begin_frame_source_; | 120 BeginFrameSource* begin_frame_source_; |
121 std::unique_ptr<OutputSurface> output_surface_; | 121 std::unique_ptr<OutputSurface> output_surface_; |
122 std::unique_ptr<DisplayScheduler> scheduler_; | 122 std::unique_ptr<DisplayScheduler> scheduler_; |
123 std::unique_ptr<ResourceProvider> resource_provider_; | 123 std::unique_ptr<ResourceProvider> resource_provider_; |
124 std::unique_ptr<SurfaceAggregator> aggregator_; | 124 std::unique_ptr<SurfaceAggregator> aggregator_; |
125 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 125 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
126 std::unique_ptr<DirectRenderer> renderer_; | 126 std::unique_ptr<DirectRenderer> renderer_; |
127 SoftwareRenderer* software_renderer_ = nullptr; | 127 SoftwareRenderer* software_renderer_ = nullptr; |
128 std::vector<ui::LatencyInfo> stored_latency_info_; | 128 std::vector<ui::LatencyInfo> stored_latency_info_; |
129 | 129 |
130 private: | 130 private: |
131 DISALLOW_COPY_AND_ASSIGN(Display); | 131 DISALLOW_COPY_AND_ASSIGN(Display); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace cc | 134 } // namespace cc |
135 | 135 |
136 #endif // CC_SURFACES_DISPLAY_H_ | 136 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |