| 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/output/renderer.h" | |
| 14 #include "cc/resources/returned_resource.h" | 13 #include "cc/resources/returned_resource.h" |
| 15 #include "cc/scheduler/begin_frame_source.h" | 14 #include "cc/scheduler/begin_frame_source.h" |
| 16 #include "cc/surfaces/display_scheduler.h" | 15 #include "cc/surfaces/display_scheduler.h" |
| 17 #include "cc/surfaces/surface_aggregator.h" | 16 #include "cc/surfaces/surface_aggregator.h" |
| 18 #include "cc/surfaces/surface_id.h" | 17 #include "cc/surfaces/surface_id.h" |
| 19 #include "cc/surfaces/surface_manager.h" | 18 #include "cc/surfaces/surface_manager.h" |
| 20 #include "cc/surfaces/surfaces_export.h" | 19 #include "cc/surfaces/surfaces_export.h" |
| 21 #include "gpu/command_buffer/common/texture_in_use_response.h" | 20 #include "gpu/command_buffer/common/texture_in_use_response.h" |
| 22 #include "ui/events/latency_info.h" | 21 #include "ui/events/latency_info.h" |
| 23 #include "ui/gfx/color_space.h" | 22 #include "ui/gfx/color_space.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const gfx::Transform& transform) override; | 98 const gfx::Transform& transform) override; |
| 100 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 99 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
| 101 void SetTreeActivationCallback(const base::Closure& callback) override; | 100 void SetTreeActivationCallback(const base::Closure& callback) override; |
| 102 void OnDraw(const gfx::Transform& transform, | 101 void OnDraw(const gfx::Transform& transform, |
| 103 const gfx::Rect& viewport, | 102 const gfx::Rect& viewport, |
| 104 bool resourceless_software_draw) override; | 103 bool resourceless_software_draw) override; |
| 105 | 104 |
| 106 // SurfaceDamageObserver implementation. | 105 // SurfaceDamageObserver implementation. |
| 107 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; | 106 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; |
| 108 | 107 |
| 109 void SetEnlargePassTextureAmountForTesting( | |
| 110 const gfx::Size& enlarge_texture_amount) { | |
| 111 enlarge_texture_amount_ = enlarge_texture_amount; | |
| 112 } | |
| 113 | |
| 114 bool has_scheduler() const { return !!scheduler_; } | 108 bool has_scheduler() const { return !!scheduler_; } |
| 115 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } | 109 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } |
| 116 | 110 |
| 117 void ForceImmediateDrawAndSwapIfPossible(); | 111 void ForceImmediateDrawAndSwapIfPossible(); |
| 118 | 112 |
| 119 private: | 113 private: |
| 120 void InitializeRenderer(); | 114 void InitializeRenderer(); |
| 121 void UpdateRootSurfaceResourcesLocked(); | 115 void UpdateRootSurfaceResourcesLocked(); |
| 122 | 116 |
| 123 SharedBitmapManager* const bitmap_manager_; | 117 SharedBitmapManager* const bitmap_manager_; |
| 124 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; | 118 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; |
| 125 const RendererSettings settings_; | 119 const RendererSettings settings_; |
| 126 | 120 |
| 127 DisplayClient* client_ = nullptr; | 121 DisplayClient* client_ = nullptr; |
| 128 SurfaceManager* surface_manager_ = nullptr; | 122 SurfaceManager* surface_manager_ = nullptr; |
| 129 uint32_t compositor_surface_namespace_; | 123 uint32_t compositor_surface_namespace_; |
| 130 SurfaceId current_surface_id_; | 124 SurfaceId current_surface_id_; |
| 131 gfx::Size current_surface_size_; | 125 gfx::Size current_surface_size_; |
| 132 float device_scale_factor_ = 1.f; | 126 float device_scale_factor_ = 1.f; |
| 133 gfx::ColorSpace device_color_space_; | 127 gfx::ColorSpace device_color_space_; |
| 134 bool visible_ = false; | 128 bool visible_ = false; |
| 135 bool swapped_since_resize_ = false; | 129 bool swapped_since_resize_ = false; |
| 136 gfx::Rect external_clip_; | 130 gfx::Rect external_clip_; |
| 137 gfx::Rect external_viewport_; | 131 gfx::Rect external_viewport_; |
| 138 gfx::Size enlarge_texture_amount_; | |
| 139 bool output_is_secure_ = false; | 132 bool output_is_secure_ = false; |
| 140 | 133 |
| 141 // The begin_frame_source_ is often known by the output_surface_ and | 134 // The begin_frame_source_ is often known by the output_surface_ and |
| 142 // the scheduler_. | 135 // the scheduler_. |
| 143 std::unique_ptr<BeginFrameSource> begin_frame_source_; | 136 std::unique_ptr<BeginFrameSource> begin_frame_source_; |
| 144 std::unique_ptr<OutputSurface> output_surface_; | 137 std::unique_ptr<OutputSurface> output_surface_; |
| 145 std::unique_ptr<DisplayScheduler> scheduler_; | 138 std::unique_ptr<DisplayScheduler> scheduler_; |
| 146 std::unique_ptr<ResourceProvider> resource_provider_; | 139 std::unique_ptr<ResourceProvider> resource_provider_; |
| 147 std::unique_ptr<SurfaceAggregator> aggregator_; | 140 std::unique_ptr<SurfaceAggregator> aggregator_; |
| 148 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 141 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
| 149 std::unique_ptr<DirectRenderer> renderer_; | 142 std::unique_ptr<DirectRenderer> renderer_; |
| 150 SoftwareRenderer* software_renderer_ = nullptr; | 143 SoftwareRenderer* software_renderer_ = nullptr; |
| 151 std::vector<ui::LatencyInfo> stored_latency_info_; | 144 std::vector<ui::LatencyInfo> stored_latency_info_; |
| 152 | 145 |
| 153 private: | 146 private: |
| 154 DISALLOW_COPY_AND_ASSIGN(Display); | 147 DISALLOW_COPY_AND_ASSIGN(Display); |
| 155 }; | 148 }; |
| 156 | 149 |
| 157 } // namespace cc | 150 } // namespace cc |
| 158 | 151 |
| 159 #endif // CC_SURFACES_DISPLAY_H_ | 152 #endif // CC_SURFACES_DISPLAY_H_ |
| OLD | NEW |