| 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/surface_aggregator.h" | 17 #include "cc/surfaces/surface_aggregator.h" |
| 17 #include "cc/surfaces/surface_id.h" | 18 #include "cc/surfaces/surface_id.h" |
| 18 #include "cc/surfaces/surface_manager.h" | 19 #include "cc/surfaces/surface_manager.h" |
| 19 #include "cc/surfaces/surfaces_export.h" | 20 #include "cc/surfaces/surfaces_export.h" |
| 20 #include "gpu/command_buffer/common/texture_in_use_response.h" | 21 #include "gpu/command_buffer/common/texture_in_use_response.h" |
| 21 #include "ui/events/latency_info.h" | 22 #include "ui/events/latency_info.h" |
| 22 #include "ui/gfx/color_space.h" | 23 #include "ui/gfx/color_space.h" |
| 23 | 24 |
| 24 namespace gpu { | 25 namespace gpu { |
| 25 class GpuMemoryBufferManager; | 26 class GpuMemoryBufferManager; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const RendererSettings& settings, | 60 const RendererSettings& settings, |
| 60 std::unique_ptr<BeginFrameSource> begin_frame_source, | 61 std::unique_ptr<BeginFrameSource> begin_frame_source, |
| 61 std::unique_ptr<OutputSurface> output_surface, | 62 std::unique_ptr<OutputSurface> output_surface, |
| 62 std::unique_ptr<DisplayScheduler> scheduler, | 63 std::unique_ptr<DisplayScheduler> scheduler, |
| 63 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); | 64 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); |
| 64 | 65 |
| 65 ~Display() override; | 66 ~Display() override; |
| 66 | 67 |
| 67 void Initialize(DisplayClient* client, | 68 void Initialize(DisplayClient* client, |
| 68 SurfaceManager* surface_manager, | 69 SurfaceManager* surface_manager, |
| 69 uint32_t compositor_surface_namespace); | 70 const FrameSinkId& frame_sink_id); |
| 70 | 71 |
| 71 // device_scale_factor is used to communicate to the external window system | 72 // device_scale_factor is used to communicate to the external window system |
| 72 // what scale this was rendered at. | 73 // what scale this was rendered at. |
| 73 void SetSurfaceId(const SurfaceId& id, float device_scale_factor); | 74 void SetSurfaceId(const SurfaceId& id, float device_scale_factor); |
| 74 void SetVisible(bool visible); | 75 void SetVisible(bool visible); |
| 75 void Resize(const gfx::Size& new_size); | 76 void Resize(const gfx::Size& new_size); |
| 76 void SetColorSpace(const gfx::ColorSpace& color_space); | 77 void SetColorSpace(const gfx::ColorSpace& color_space); |
| 77 void SetExternalClip(const gfx::Rect& clip); | 78 void SetExternalClip(const gfx::Rect& clip); |
| 78 void SetExternalViewport(const gfx::Rect& viewport); | 79 void SetExternalViewport(const gfx::Rect& viewport); |
| 79 void SetOutputIsSecure(bool secure); | 80 void SetOutputIsSecure(bool secure); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 private: | 112 private: |
| 112 void InitializeRenderer(); | 113 void InitializeRenderer(); |
| 113 void UpdateRootSurfaceResourcesLocked(); | 114 void UpdateRootSurfaceResourcesLocked(); |
| 114 | 115 |
| 115 SharedBitmapManager* const bitmap_manager_; | 116 SharedBitmapManager* const bitmap_manager_; |
| 116 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; | 117 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; |
| 117 const RendererSettings settings_; | 118 const RendererSettings settings_; |
| 118 | 119 |
| 119 DisplayClient* client_ = nullptr; | 120 DisplayClient* client_ = nullptr; |
| 120 SurfaceManager* surface_manager_ = nullptr; | 121 SurfaceManager* surface_manager_ = nullptr; |
| 121 uint32_t compositor_surface_namespace_; | 122 FrameSinkId frame_sink_id_; |
| 122 SurfaceId current_surface_id_; | 123 SurfaceId current_surface_id_; |
| 123 gfx::Size current_surface_size_; | 124 gfx::Size current_surface_size_; |
| 124 float device_scale_factor_ = 1.f; | 125 float device_scale_factor_ = 1.f; |
| 125 gfx::ColorSpace device_color_space_; | 126 gfx::ColorSpace device_color_space_; |
| 126 bool visible_ = false; | 127 bool visible_ = false; |
| 127 bool swapped_since_resize_ = false; | 128 bool swapped_since_resize_ = false; |
| 128 gfx::Rect external_clip_; | 129 gfx::Rect external_clip_; |
| 129 gfx::Rect external_viewport_; | 130 gfx::Rect external_viewport_; |
| 130 bool output_is_secure_ = false; | 131 bool output_is_secure_ = false; |
| 131 | 132 |
| 132 // The begin_frame_source_ is often known by the output_surface_ and | 133 // The begin_frame_source_ is often known by the output_surface_ and |
| 133 // the scheduler_. | 134 // the scheduler_. |
| 134 std::unique_ptr<BeginFrameSource> begin_frame_source_; | 135 std::unique_ptr<BeginFrameSource> begin_frame_source_; |
| 135 std::unique_ptr<OutputSurface> output_surface_; | 136 std::unique_ptr<OutputSurface> output_surface_; |
| 136 std::unique_ptr<DisplayScheduler> scheduler_; | 137 std::unique_ptr<DisplayScheduler> scheduler_; |
| 137 std::unique_ptr<ResourceProvider> resource_provider_; | 138 std::unique_ptr<ResourceProvider> resource_provider_; |
| 138 std::unique_ptr<SurfaceAggregator> aggregator_; | 139 std::unique_ptr<SurfaceAggregator> aggregator_; |
| 139 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 140 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
| 140 std::unique_ptr<DirectRenderer> renderer_; | 141 std::unique_ptr<DirectRenderer> renderer_; |
| 141 SoftwareRenderer* software_renderer_ = nullptr; | 142 SoftwareRenderer* software_renderer_ = nullptr; |
| 142 std::vector<ui::LatencyInfo> stored_latency_info_; | 143 std::vector<ui::LatencyInfo> stored_latency_info_; |
| 143 | 144 |
| 144 private: | 145 private: |
| 145 DISALLOW_COPY_AND_ASSIGN(Display); | 146 DISALLOW_COPY_AND_ASSIGN(Display); |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 } // namespace cc | 149 } // namespace cc |
| 149 | 150 |
| 150 #endif // CC_SURFACES_DISPLAY_H_ | 151 #endif // CC_SURFACES_DISPLAY_H_ |
| OLD | NEW |