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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void Initialize(DisplayClient* client, | 68 void Initialize(DisplayClient* client, |
69 SurfaceManager* surface_manager, | 69 SurfaceManager* surface_manager, |
70 const FrameSinkId& frame_sink_id); | 70 const FrameSinkId& frame_sink_id); |
71 | 71 |
72 // 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 |
73 // what scale this was rendered at. | 73 // what scale this was rendered at. |
74 void SetSurfaceId(const SurfaceId& id, float device_scale_factor); | 74 void SetSurfaceId(const SurfaceId& id, float device_scale_factor); |
75 void SetVisible(bool visible); | 75 void SetVisible(bool visible); |
76 void Resize(const gfx::Size& new_size); | 76 void Resize(const gfx::Size& new_size); |
77 void SetColorSpace(const gfx::ColorSpace& color_space); | 77 void SetColorSpace(const gfx::ColorSpace& color_space); |
78 void SetExternalClip(const gfx::Rect& clip); | |
79 void SetExternalViewport(const gfx::Rect& viewport); | |
80 void SetOutputIsSecure(bool secure); | 78 void SetOutputIsSecure(bool secure); |
81 | 79 |
82 const SurfaceId& CurrentSurfaceId(); | 80 const SurfaceId& CurrentSurfaceId(); |
83 | 81 |
84 // DisplaySchedulerClient implementation. | 82 // DisplaySchedulerClient implementation. |
85 bool DrawAndSwap() override; | 83 bool DrawAndSwap() override; |
86 | 84 |
87 // OutputSurfaceClient implementation. | 85 // OutputSurfaceClient implementation. |
88 void SetBeginFrameSource(BeginFrameSource* source) override; | 86 void SetBeginFrameSource(BeginFrameSource* source) override; |
89 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; | 87 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; |
(...skipping 29 matching lines...) Expand all Loading... |
119 | 117 |
120 DisplayClient* client_ = nullptr; | 118 DisplayClient* client_ = nullptr; |
121 SurfaceManager* surface_manager_ = nullptr; | 119 SurfaceManager* surface_manager_ = nullptr; |
122 FrameSinkId frame_sink_id_; | 120 FrameSinkId frame_sink_id_; |
123 SurfaceId current_surface_id_; | 121 SurfaceId current_surface_id_; |
124 gfx::Size current_surface_size_; | 122 gfx::Size current_surface_size_; |
125 float device_scale_factor_ = 1.f; | 123 float device_scale_factor_ = 1.f; |
126 gfx::ColorSpace device_color_space_; | 124 gfx::ColorSpace device_color_space_; |
127 bool visible_ = false; | 125 bool visible_ = false; |
128 bool swapped_since_resize_ = false; | 126 bool swapped_since_resize_ = false; |
129 gfx::Rect external_clip_; | |
130 gfx::Rect external_viewport_; | |
131 bool output_is_secure_ = false; | 127 bool output_is_secure_ = false; |
132 | 128 |
133 // The begin_frame_source_ is often known by the output_surface_ and | 129 // The begin_frame_source_ is often known by the output_surface_ and |
134 // the scheduler_. | 130 // the scheduler_. |
135 std::unique_ptr<BeginFrameSource> begin_frame_source_; | 131 std::unique_ptr<BeginFrameSource> begin_frame_source_; |
136 std::unique_ptr<OutputSurface> output_surface_; | 132 std::unique_ptr<OutputSurface> output_surface_; |
137 std::unique_ptr<DisplayScheduler> scheduler_; | 133 std::unique_ptr<DisplayScheduler> scheduler_; |
138 std::unique_ptr<ResourceProvider> resource_provider_; | 134 std::unique_ptr<ResourceProvider> resource_provider_; |
139 std::unique_ptr<SurfaceAggregator> aggregator_; | 135 std::unique_ptr<SurfaceAggregator> aggregator_; |
140 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 136 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
141 std::unique_ptr<DirectRenderer> renderer_; | 137 std::unique_ptr<DirectRenderer> renderer_; |
142 SoftwareRenderer* software_renderer_ = nullptr; | 138 SoftwareRenderer* software_renderer_ = nullptr; |
143 std::vector<ui::LatencyInfo> stored_latency_info_; | 139 std::vector<ui::LatencyInfo> stored_latency_info_; |
144 | 140 |
145 private: | 141 private: |
146 DISALLOW_COPY_AND_ASSIGN(Display); | 142 DISALLOW_COPY_AND_ASSIGN(Display); |
147 }; | 143 }; |
148 | 144 |
149 } // namespace cc | 145 } // namespace cc |
150 | 146 |
151 #endif // CC_SURFACES_DISPLAY_H_ | 147 #endif // CC_SURFACES_DISPLAY_H_ |
OLD | NEW |