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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class SurfaceIdAllocator; | 42 class SurfaceIdAllocator; |
43 class SurfaceFactory; | 43 class SurfaceFactory; |
44 class TextureMailboxDeleter; | 44 class TextureMailboxDeleter; |
45 | 45 |
46 // A Display produces a surface that can be used to draw to a physical display | 46 // A Display produces a surface that can be used to draw to a physical display |
47 // (OutputSurface). The client is responsible for creating and sizing the | 47 // (OutputSurface). The client is responsible for creating and sizing the |
48 // surface IDs used to draw into the display and deciding when to draw. | 48 // surface IDs used to draw into the display and deciding when to draw. |
49 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, | 49 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, |
50 public OutputSurfaceClient, | 50 public OutputSurfaceClient, |
51 public RendererClient, | 51 public RendererClient, |
52 public SurfaceAggregatorClient, | |
53 public SurfaceDamageObserver { | 52 public SurfaceDamageObserver { |
54 public: | 53 public: |
55 Display(DisplayClient* client, | 54 Display(DisplayClient* client, |
56 SurfaceManager* manager, | 55 SurfaceManager* manager, |
57 SharedBitmapManager* bitmap_manager, | 56 SharedBitmapManager* bitmap_manager, |
58 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 57 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
59 const RendererSettings& settings); | 58 const RendererSettings& settings); |
60 ~Display() override; | 59 ~Display() override; |
61 | 60 |
62 bool Initialize(scoped_ptr<OutputSurface> output_surface, | 61 bool Initialize(scoped_ptr<OutputSurface> output_surface, |
63 DisplayScheduler* scheduler); | 62 DisplayScheduler* scheduler); |
64 | 63 |
65 // device_scale_factor is used to communicate to the external window system | 64 // device_scale_factor is used to communicate to the external window system |
66 // what scale this was rendered at. | 65 // what scale this was rendered at. |
67 void SetSurfaceId(SurfaceId id, float device_scale_factor); | 66 void SetSurfaceId(SurfaceId id, float device_scale_factor); |
68 void Resize(const gfx::Size& new_size); | 67 void Resize(const gfx::Size& new_size); |
69 void SetExternalClip(const gfx::Rect& clip); | 68 void SetExternalClip(const gfx::Rect& clip); |
70 | 69 |
71 SurfaceId CurrentSurfaceId(); | 70 SurfaceId CurrentSurfaceId(); |
72 | 71 |
73 // SurfaceAggregatorClient implementation | |
74 void AddSurface(Surface* surface) override; | |
75 void RemoveSurface(Surface* surface) override; | |
76 | |
77 // DisplaySchedulerClient implementation. | 72 // DisplaySchedulerClient implementation. |
78 bool DrawAndSwap() override; | 73 bool DrawAndSwap() override; |
79 | 74 |
80 // OutputSurfaceClient implementation. | 75 // OutputSurfaceClient implementation. |
81 void CommitVSyncParameters(base::TimeTicks timebase, | 76 void CommitVSyncParameters(base::TimeTicks timebase, |
82 base::TimeDelta interval) override; | 77 base::TimeDelta interval) override; |
83 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; | 78 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; |
84 void DidSwapBuffers() override; | 79 void DidSwapBuffers() override; |
85 void DidSwapBuffersComplete() override; | 80 void DidSwapBuffersComplete() override; |
86 void ReclaimResources(const CompositorFrameAck* ack) override; | 81 void ReclaimResources(const CompositorFrameAck* ack) override; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 scoped_ptr<DirectRenderer> renderer_; | 117 scoped_ptr<DirectRenderer> renderer_; |
123 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 118 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
124 std::vector<ui::LatencyInfo> stored_latency_info_; | 119 std::vector<ui::LatencyInfo> stored_latency_info_; |
125 | 120 |
126 DISALLOW_COPY_AND_ASSIGN(Display); | 121 DISALLOW_COPY_AND_ASSIGN(Display); |
127 }; | 122 }; |
128 | 123 |
129 } // namespace cc | 124 } // namespace cc |
130 | 125 |
131 #endif // CC_SURFACES_DISPLAY_H_ | 126 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |