| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 public: | 105 public: |
| 106 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); | 106 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); |
| 107 | 107 |
| 108 bool flipped() const { return flipped_; } | 108 bool flipped() const { return flipped_; } |
| 109 gfx::Size size() const { return size_; } | 109 gfx::Size size() const { return size_; } |
| 110 float device_scale_factor() const { return device_scale_factor_; } | 110 float device_scale_factor() const { return device_scale_factor_; } |
| 111 | 111 |
| 112 virtual unsigned int PrepareTexture() = 0; | 112 virtual unsigned int PrepareTexture() = 0; |
| 113 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; | 113 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; |
| 114 | 114 |
| 115 virtual void Consume(const gfx::Size& new_size) {} | |
| 116 virtual void Produce() {} | |
| 117 | |
| 118 protected: | 115 protected: |
| 119 virtual ~Texture(); | 116 virtual ~Texture(); |
| 120 gfx::Size size_; // in pixel | |
| 121 | 117 |
| 122 private: | 118 private: |
| 123 friend class base::RefCounted<Texture>; | 119 friend class base::RefCounted<Texture>; |
| 124 | 120 |
| 125 bool flipped_; | 121 bool flipped_; |
| 122 gfx::Size size_; // in pixel |
| 126 float device_scale_factor_; | 123 float device_scale_factor_; |
| 127 | 124 |
| 128 DISALLOW_COPY_AND_ASSIGN(Texture); | 125 DISALLOW_COPY_AND_ASSIGN(Texture); |
| 129 }; | 126 }; |
| 130 | 127 |
| 131 // An interface to allow the compositor to communicate with its owner. | 128 // An interface to allow the compositor to communicate with its owner. |
| 132 class COMPOSITOR_EXPORT CompositorDelegate { | 129 class COMPOSITOR_EXPORT CompositorDelegate { |
| 133 public: | 130 public: |
| 134 // Requests the owner to schedule a redraw of the layer tree. | 131 // Requests the owner to schedule a redraw of the layer tree. |
| 135 virtual void ScheduleDraw() = 0; | 132 virtual void ScheduleDraw() = 0; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 bool disable_schedule_composite_; | 305 bool disable_schedule_composite_; |
| 309 | 306 |
| 310 CompositorLock* compositor_lock_; | 307 CompositorLock* compositor_lock_; |
| 311 | 308 |
| 312 DISALLOW_COPY_AND_ASSIGN(Compositor); | 309 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 313 }; | 310 }; |
| 314 | 311 |
| 315 } // namespace ui | 312 } // namespace ui |
| 316 | 313 |
| 317 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 314 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |