| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 public: | 96 public: |
| 97 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); | 97 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); |
| 98 | 98 |
| 99 bool flipped() const { return flipped_; } | 99 bool flipped() const { return flipped_; } |
| 100 gfx::Size size() const { return size_; } | 100 gfx::Size size() const { return size_; } |
| 101 float device_scale_factor() const { return device_scale_factor_; } | 101 float device_scale_factor() const { return device_scale_factor_; } |
| 102 | 102 |
| 103 virtual unsigned int PrepareTexture() = 0; | 103 virtual unsigned int PrepareTexture() = 0; |
| 104 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; | 104 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; |
| 105 | 105 |
| 106 virtual void Consume(const gfx::Size& new_size) {} |
| 107 virtual void Produce() {} |
| 108 |
| 106 protected: | 109 protected: |
| 107 virtual ~Texture(); | 110 virtual ~Texture(); |
| 111 gfx::Size size_; // in pixel |
| 108 | 112 |
| 109 private: | 113 private: |
| 110 friend class base::RefCounted<Texture>; | 114 friend class base::RefCounted<Texture>; |
| 111 | 115 |
| 112 bool flipped_; | 116 bool flipped_; |
| 113 gfx::Size size_; // in pixel | |
| 114 float device_scale_factor_; | 117 float device_scale_factor_; |
| 115 | 118 |
| 116 DISALLOW_COPY_AND_ASSIGN(Texture); | 119 DISALLOW_COPY_AND_ASSIGN(Texture); |
| 117 }; | 120 }; |
| 118 | 121 |
| 119 // An interface to allow the compositor to communicate with its owner. | 122 // An interface to allow the compositor to communicate with its owner. |
| 120 class COMPOSITOR_EXPORT CompositorDelegate { | 123 class COMPOSITOR_EXPORT CompositorDelegate { |
| 121 public: | 124 public: |
| 122 // Requests the owner to schedule a redraw of the layer tree. | 125 // Requests the owner to schedule a redraw of the layer tree. |
| 123 virtual void ScheduleDraw() = 0; | 126 virtual void ScheduleDraw() = 0; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 int last_ended_frame_; | 260 int last_ended_frame_; |
| 258 | 261 |
| 259 bool disable_schedule_composite_; | 262 bool disable_schedule_composite_; |
| 260 | 263 |
| 261 DISALLOW_COPY_AND_ASSIGN(Compositor); | 264 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 262 }; | 265 }; |
| 263 | 266 |
| 264 } // namespace ui | 267 } // namespace ui |
| 265 | 268 |
| 266 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 269 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |