OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ |
6 #define UI_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // Draws the scene created by the layer tree and any visual effects. If | 208 // Draws the scene created by the layer tree and any visual effects. If |
209 // |force_clear| is true, this will cause the compositor to clear before | 209 // |force_clear| is true, this will cause the compositor to clear before |
210 // compositing. | 210 // compositing. |
211 void Draw(bool force_clear); | 211 void Draw(bool force_clear); |
212 | 212 |
213 // Where possible, draws are scissored to a damage region calculated from | 213 // Where possible, draws are scissored to a damage region calculated from |
214 // changes to layer properties. This bypasses that and indicates that | 214 // changes to layer properties. This bypasses that and indicates that |
215 // the whole frame needs to be drawn. | 215 // the whole frame needs to be drawn. |
216 void ScheduleFullDraw(); | 216 void ScheduleFullDraw(); |
217 | 217 |
| 218 int64 SetInputNumber(int64 input_number); |
| 219 |
218 // Reads the region |bounds_in_pixel| of the contents of the last rendered | 220 // Reads the region |bounds_in_pixel| of the contents of the last rendered |
219 // frame into the given bitmap. | 221 // frame into the given bitmap. |
220 // Returns false if the pixels could not be read. | 222 // Returns false if the pixels could not be read. |
221 bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds_in_pixel); | 223 bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds_in_pixel); |
222 | 224 |
223 // Sets the compositor's device scale factor and size. | 225 // Sets the compositor's device scale factor and size. |
224 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); | 226 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); |
225 | 227 |
226 // Returns the size of the widget that is being drawn to in pixel coordinates. | 228 // Returns the size of the widget that is being drawn to in pixel coordinates. |
227 const gfx::Size& size() const { return size_; } | 229 const gfx::Size& size() const { return size_; } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 virtual scoped_ptr<cc::OutputSurface> | 263 virtual scoped_ptr<cc::OutputSurface> |
262 createOutputSurface() OVERRIDE; | 264 createOutputSurface() OVERRIDE; |
263 virtual void didRecreateOutputSurface(bool success) OVERRIDE; | 265 virtual void didRecreateOutputSurface(bool success) OVERRIDE; |
264 virtual scoped_ptr<cc::InputHandler> createInputHandler() OVERRIDE; | 266 virtual scoped_ptr<cc::InputHandler> createInputHandler() OVERRIDE; |
265 virtual void willCommit() OVERRIDE; | 267 virtual void willCommit() OVERRIDE; |
266 virtual void didCommit() OVERRIDE; | 268 virtual void didCommit() OVERRIDE; |
267 virtual void didCommitAndDrawFrame() OVERRIDE; | 269 virtual void didCommitAndDrawFrame() OVERRIDE; |
268 virtual void didCompleteSwapBuffers() OVERRIDE; | 270 virtual void didCompleteSwapBuffers() OVERRIDE; |
269 virtual void scheduleComposite() OVERRIDE; | 271 virtual void scheduleComposite() OVERRIDE; |
270 virtual scoped_ptr<cc::FontAtlas> createFontAtlas() OVERRIDE; | 272 virtual scoped_ptr<cc::FontAtlas> createFontAtlas() OVERRIDE; |
271 | 273 virtual void onReceivedLatencyInfo( |
| 274 const cc::LatencyInfo& latencyInfo) OVERRIDE; |
272 | 275 |
273 int last_started_frame() { return last_started_frame_; } | 276 int last_started_frame() { return last_started_frame_; } |
274 int last_ended_frame() { return last_ended_frame_; } | 277 int last_ended_frame() { return last_ended_frame_; } |
275 | 278 |
276 bool IsLocked() { return compositor_lock_ != NULL; } | 279 bool IsLocked() { return compositor_lock_ != NULL; } |
277 | 280 |
278 private: | 281 private: |
279 friend class base::RefCounted<Compositor>; | 282 friend class base::RefCounted<Compositor>; |
280 friend class CompositorLock; | 283 friend class CompositorLock; |
281 | 284 |
(...skipping 21 matching lines...) Expand all Loading... |
303 // Used to verify that we have at most one draw swap in flight. | 306 // Used to verify that we have at most one draw swap in flight. |
304 scoped_ptr<PostedSwapQueue> posted_swaps_; | 307 scoped_ptr<PostedSwapQueue> posted_swaps_; |
305 | 308 |
306 // The device scale factor of the monitor that this compositor is compositing | 309 // The device scale factor of the monitor that this compositor is compositing |
307 // layers on. | 310 // layers on. |
308 float device_scale_factor_; | 311 float device_scale_factor_; |
309 | 312 |
310 int last_started_frame_; | 313 int last_started_frame_; |
311 int last_ended_frame_; | 314 int last_ended_frame_; |
312 | 315 |
| 316 int64 frame_number_; |
| 317 |
313 bool disable_schedule_composite_; | 318 bool disable_schedule_composite_; |
314 | 319 |
315 CompositorLock* compositor_lock_; | 320 CompositorLock* compositor_lock_; |
316 | 321 |
317 DISALLOW_COPY_AND_ASSIGN(Compositor); | 322 DISALLOW_COPY_AND_ASSIGN(Compositor); |
318 }; | 323 }; |
319 | 324 |
320 } // namespace ui | 325 } // namespace ui |
321 | 326 |
322 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 327 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |