| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class SurfaceAggregator; | 44 class SurfaceAggregator; |
| 45 class SurfaceIdAllocator; | 45 class SurfaceIdAllocator; |
| 46 class SurfaceFactory; | 46 class SurfaceFactory; |
| 47 class TextureMailboxDeleter; | 47 class TextureMailboxDeleter; |
| 48 | 48 |
| 49 // A Display produces a surface that can be used to draw to a physical display | 49 // A Display produces a surface that can be used to draw to a physical display |
| 50 // (OutputSurface). The client is responsible for creating and sizing the | 50 // (OutputSurface). The client is responsible for creating and sizing the |
| 51 // surface IDs used to draw into the display and deciding when to draw. | 51 // surface IDs used to draw into the display and deciding when to draw. |
| 52 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, | 52 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, |
| 53 public OutputSurfaceClient, | 53 public OutputSurfaceClient, |
| 54 public SurfaceDamageObserver { | 54 public SurfaceObserver { |
| 55 public: | 55 public: |
| 56 // The |begin_frame_source| and |scheduler| may be null (together). In that | 56 // The |begin_frame_source| and |scheduler| may be null (together). In that |
| 57 // case, DrawAndSwap must be called externally when needed. | 57 // case, DrawAndSwap must be called externally when needed. |
| 58 Display(SharedBitmapManager* bitmap_manager, | 58 Display(SharedBitmapManager* bitmap_manager, |
| 59 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 59 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 60 const RendererSettings& settings, | 60 const RendererSettings& settings, |
| 61 std::unique_ptr<BeginFrameSource> begin_frame_source, | 61 std::unique_ptr<BeginFrameSource> begin_frame_source, |
| 62 std::unique_ptr<OutputSurface> output_surface, | 62 std::unique_ptr<OutputSurface> output_surface, |
| 63 std::unique_ptr<DisplayScheduler> scheduler, | 63 std::unique_ptr<DisplayScheduler> scheduler, |
| 64 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); | 64 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 92 void DidLoseOutputSurface() override; | 92 void DidLoseOutputSurface() override; |
| 93 void SetExternalTilePriorityConstraints( | 93 void SetExternalTilePriorityConstraints( |
| 94 const gfx::Rect& viewport_rect, | 94 const gfx::Rect& viewport_rect, |
| 95 const gfx::Transform& transform) override; | 95 const gfx::Transform& transform) override; |
| 96 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; | 96 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; |
| 97 void SetTreeActivationCallback(const base::Closure& callback) override; | 97 void SetTreeActivationCallback(const base::Closure& callback) override; |
| 98 void OnDraw(const gfx::Transform& transform, | 98 void OnDraw(const gfx::Transform& transform, |
| 99 const gfx::Rect& viewport, | 99 const gfx::Rect& viewport, |
| 100 bool resourceless_software_draw) override; | 100 bool resourceless_software_draw) override; |
| 101 | 101 |
| 102 // SurfaceDamageObserver implementation. | 102 // SurfaceObserver implementation. |
| 103 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; | 103 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; |
| 104 void OnSurfaceCreated(const SurfaceId& surface_id, |
| 105 const gfx::Size& frame, |
| 106 float device_scale_factor) override; |
| 104 | 107 |
| 105 bool has_scheduler() const { return !!scheduler_; } | 108 bool has_scheduler() const { return !!scheduler_; } |
| 106 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } | 109 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } |
| 107 | 110 |
| 108 void ForceImmediateDrawAndSwapIfPossible(); | 111 void ForceImmediateDrawAndSwapIfPossible(); |
| 109 | 112 |
| 110 private: | 113 private: |
| 111 void InitializeRenderer(); | 114 void InitializeRenderer(); |
| 112 void UpdateRootSurfaceResourcesLocked(); | 115 void UpdateRootSurfaceResourcesLocked(); |
| 113 | 116 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 138 SoftwareRenderer* software_renderer_ = nullptr; | 141 SoftwareRenderer* software_renderer_ = nullptr; |
| 139 std::vector<ui::LatencyInfo> stored_latency_info_; | 142 std::vector<ui::LatencyInfo> stored_latency_info_; |
| 140 | 143 |
| 141 private: | 144 private: |
| 142 DISALLOW_COPY_AND_ASSIGN(Display); | 145 DISALLOW_COPY_AND_ASSIGN(Display); |
| 143 }; | 146 }; |
| 144 | 147 |
| 145 } // namespace cc | 148 } // namespace cc |
| 146 | 149 |
| 147 #endif // CC_SURFACES_DISPLAY_H_ | 150 #endif // CC_SURFACES_DISPLAY_H_ |
| OLD | NEW |