| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 class WebGraphicsContext3D; | 47 class WebGraphicsContext3D; |
| 48 } | 48 } |
| 49 | 49 |
| 50 namespace ui { | 50 namespace ui { |
| 51 | 51 |
| 52 class Compositor; | 52 class Compositor; |
| 53 class CompositorObserver; | 53 class CompositorObserver; |
| 54 class ContextProviderFromContextFactory; | 54 class ContextProviderFromContextFactory; |
| 55 class Layer; | 55 class Layer; |
| 56 class PostedSwapQueue; | 56 class PostedSwapQueue; |
| 57 struct LatencyInfo; |
| 57 | 58 |
| 58 // This class abstracts the creation of the 3D context for the compositor. It is | 59 // This class abstracts the creation of the 3D context for the compositor. It is |
| 59 // a global object. | 60 // a global object. |
| 60 class COMPOSITOR_EXPORT ContextFactory { | 61 class COMPOSITOR_EXPORT ContextFactory { |
| 61 public: | 62 public: |
| 62 virtual ~ContextFactory() {} | 63 virtual ~ContextFactory() {} |
| 63 | 64 |
| 64 // Gets the global instance. | 65 // Gets the global instance. |
| 65 static ContextFactory* GetInstance(); | 66 static ContextFactory* GetInstance(); |
| 66 | 67 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 289 |
| 289 // Where possible, draws are scissored to a damage region calculated from | 290 // Where possible, draws are scissored to a damage region calculated from |
| 290 // changes to layer properties. This bypasses that and indicates that | 291 // changes to layer properties. This bypasses that and indicates that |
| 291 // the whole frame needs to be drawn. | 292 // the whole frame needs to be drawn. |
| 292 void ScheduleFullRedraw(); | 293 void ScheduleFullRedraw(); |
| 293 | 294 |
| 294 // Schedule redraw and append damage_rect to the damage region calculated | 295 // Schedule redraw and append damage_rect to the damage region calculated |
| 295 // from changes to layer properties. | 296 // from changes to layer properties. |
| 296 void ScheduleRedrawRect(const gfx::Rect& damage_rect); | 297 void ScheduleRedrawRect(const gfx::Rect& damage_rect); |
| 297 | 298 |
| 299 void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
| 300 |
| 298 // Reads the region |bounds_in_pixel| of the contents of the last rendered | 301 // Reads the region |bounds_in_pixel| of the contents of the last rendered |
| 299 // frame into the given bitmap. | 302 // frame into the given bitmap. |
| 300 // Returns false if the pixels could not be read. | 303 // Returns false if the pixels could not be read. |
| 301 bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds_in_pixel); | 304 bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds_in_pixel); |
| 302 | 305 |
| 303 // Sets the compositor's device scale factor and size. | 306 // Sets the compositor's device scale factor and size. |
| 304 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); | 307 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); |
| 305 | 308 |
| 306 // Returns the size of the widget that is being drawn to in pixel coordinates. | 309 // Returns the size of the widget that is being drawn to in pixel coordinates. |
| 307 const gfx::Size& size() const { return size_; } | 310 const gfx::Size& size() const { return size_; } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 bool disable_schedule_composite_; | 409 bool disable_schedule_composite_; |
| 407 | 410 |
| 408 CompositorLock* compositor_lock_; | 411 CompositorLock* compositor_lock_; |
| 409 | 412 |
| 410 DISALLOW_COPY_AND_ASSIGN(Compositor); | 413 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 411 }; | 414 }; |
| 412 | 415 |
| 413 } // namespace ui | 416 } // namespace ui |
| 414 | 417 |
| 415 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 418 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |