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