| 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 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "cc/output/output_surface_client.h" | 12 #include "cc/output/output_surface_client.h" |
| 13 #include "cc/resources/returned_resource.h" | 13 #include "cc/resources/returned_resource.h" |
| 14 #include "cc/scheduler/begin_frame_source.h" | 14 #include "cc/scheduler/begin_frame_source.h" |
| 15 #include "cc/surfaces/display_scheduler.h" | 15 #include "cc/surfaces/display_scheduler.h" |
| 16 #include "cc/surfaces/frame_sink_id.h" | 16 #include "cc/surfaces/frame_sink_id.h" |
| 17 #include "cc/surfaces/framesink_manager.h" |
| 17 #include "cc/surfaces/surface_aggregator.h" | 18 #include "cc/surfaces/surface_aggregator.h" |
| 18 #include "cc/surfaces/surface_id.h" | 19 #include "cc/surfaces/surface_id.h" |
| 19 #include "cc/surfaces/surface_manager.h" | 20 #include "cc/surfaces/surface_manager.h" |
| 20 #include "cc/surfaces/surfaces_export.h" | 21 #include "cc/surfaces/surfaces_export.h" |
| 21 #include "gpu/command_buffer/common/texture_in_use_response.h" | 22 #include "gpu/command_buffer/common/texture_in_use_response.h" |
| 22 #include "ui/events/latency_info.h" | 23 #include "ui/events/latency_info.h" |
| 23 #include "ui/gfx/color_space.h" | 24 #include "ui/gfx/color_space.h" |
| 24 | 25 |
| 25 namespace gpu { | 26 namespace gpu { |
| 26 class GpuMemoryBufferManager; | 27 class GpuMemoryBufferManager; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 56 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 57 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 57 const RendererSettings& settings, | 58 const RendererSettings& settings, |
| 58 const FrameSinkId& frame_sink_id, | 59 const FrameSinkId& frame_sink_id, |
| 59 BeginFrameSource* begin_frame_source, | 60 BeginFrameSource* begin_frame_source, |
| 60 std::unique_ptr<OutputSurface> output_surface, | 61 std::unique_ptr<OutputSurface> output_surface, |
| 61 std::unique_ptr<DisplayScheduler> scheduler, | 62 std::unique_ptr<DisplayScheduler> scheduler, |
| 62 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); | 63 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); |
| 63 | 64 |
| 64 ~Display() override; | 65 ~Display() override; |
| 65 | 66 |
| 66 void Initialize(DisplayClient* client, SurfaceManager* surface_manager); | 67 void Initialize(DisplayClient* client, SurfaceManager* surface_manager, |
| 68 FrameSinkManager* framesink_manager); |
| 67 | 69 |
| 68 // device_scale_factor is used to communicate to the external window system | 70 // device_scale_factor is used to communicate to the external window system |
| 69 // what scale this was rendered at. | 71 // what scale this was rendered at. |
| 70 void SetLocalSurfaceId(const LocalSurfaceId& id, float device_scale_factor); | 72 void SetLocalSurfaceId(const LocalSurfaceId& id, float device_scale_factor); |
| 71 void SetVisible(bool visible); | 73 void SetVisible(bool visible); |
| 72 void Resize(const gfx::Size& new_size); | 74 void Resize(const gfx::Size& new_size); |
| 73 void SetColorSpace(const gfx::ColorSpace& color_space); | 75 void SetColorSpace(const gfx::ColorSpace& color_space); |
| 74 void SetOutputIsSecure(bool secure); | 76 void SetOutputIsSecure(bool secure); |
| 75 | 77 |
| 76 const SurfaceId& CurrentSurfaceId(); | 78 const SurfaceId& CurrentSurfaceId(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 97 void InitializeRenderer(); | 99 void InitializeRenderer(); |
| 98 void UpdateRootSurfaceResourcesLocked(); | 100 void UpdateRootSurfaceResourcesLocked(); |
| 99 void DidLoseContextProvider(); | 101 void DidLoseContextProvider(); |
| 100 | 102 |
| 101 SharedBitmapManager* const bitmap_manager_; | 103 SharedBitmapManager* const bitmap_manager_; |
| 102 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; | 104 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; |
| 103 const RendererSettings settings_; | 105 const RendererSettings settings_; |
| 104 | 106 |
| 105 DisplayClient* client_ = nullptr; | 107 DisplayClient* client_ = nullptr; |
| 106 SurfaceManager* surface_manager_ = nullptr; | 108 SurfaceManager* surface_manager_ = nullptr; |
| 109 FrameSinkManager* framesink_manager_ = nullptr; |
| 107 const FrameSinkId frame_sink_id_; | 110 const FrameSinkId frame_sink_id_; |
| 108 SurfaceId current_surface_id_; | 111 SurfaceId current_surface_id_; |
| 109 gfx::Size current_surface_size_; | 112 gfx::Size current_surface_size_; |
| 110 float device_scale_factor_ = 1.f; | 113 float device_scale_factor_ = 1.f; |
| 111 gfx::ColorSpace device_color_space_; | 114 gfx::ColorSpace device_color_space_; |
| 112 bool visible_ = false; | 115 bool visible_ = false; |
| 113 bool swapped_since_resize_ = false; | 116 bool swapped_since_resize_ = false; |
| 114 bool output_is_secure_ = false; | 117 bool output_is_secure_ = false; |
| 115 | 118 |
| 116 // The begin_frame_source_ is not owned here, and also often known by the | 119 // The begin_frame_source_ is not owned here, and also often known by the |
| 117 // output_surface_ and the scheduler_. | 120 // output_surface_ and the scheduler_. |
| 118 BeginFrameSource* begin_frame_source_; | 121 BeginFrameSource* begin_frame_source_; |
| 119 std::unique_ptr<OutputSurface> output_surface_; | 122 std::unique_ptr<OutputSurface> output_surface_; |
| 120 std::unique_ptr<DisplayScheduler> scheduler_; | 123 std::unique_ptr<DisplayScheduler> scheduler_; |
| 121 std::unique_ptr<ResourceProvider> resource_provider_; | 124 std::unique_ptr<ResourceProvider> resource_provider_; |
| 122 std::unique_ptr<SurfaceAggregator> aggregator_; | 125 std::unique_ptr<SurfaceAggregator> aggregator_; |
| 123 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 126 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
| 124 std::unique_ptr<DirectRenderer> renderer_; | 127 std::unique_ptr<DirectRenderer> renderer_; |
| 125 SoftwareRenderer* software_renderer_ = nullptr; | 128 SoftwareRenderer* software_renderer_ = nullptr; |
| 126 std::vector<ui::LatencyInfo> stored_latency_info_; | 129 std::vector<ui::LatencyInfo> stored_latency_info_; |
| 127 | 130 |
| 128 private: | 131 private: |
| 129 DISALLOW_COPY_AND_ASSIGN(Display); | 132 DISALLOW_COPY_AND_ASSIGN(Display); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace cc | 135 } // namespace cc |
| 133 | 136 |
| 134 #endif // CC_SURFACES_DISPLAY_H_ | 137 #endif // CC_SURFACES_DISPLAY_H_ |
| OLD | NEW |