| 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 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace gfx { | 30 namespace gfx { |
| 31 class GLContext; | 31 class GLContext; |
| 32 class GLSurface; | 32 class GLSurface; |
| 33 class GLShareGroup; | 33 class GLShareGroup; |
| 34 class Point; | 34 class Point; |
| 35 class Rect; | 35 class Rect; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace gpu { |
| 39 struct Mailbox; |
| 40 } |
| 41 |
| 38 namespace WebKit { | 42 namespace WebKit { |
| 39 class WebGraphicsContext3D; | 43 class WebGraphicsContext3D; |
| 40 } | 44 } |
| 41 | 45 |
| 42 namespace ui { | 46 namespace ui { |
| 43 | 47 |
| 44 class Compositor; | 48 class Compositor; |
| 45 class CompositorObserver; | 49 class CompositorObserver; |
| 46 class Layer; | 50 class Layer; |
| 47 class PostedSwapQueue; | 51 class PostedSwapQueue; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); | 125 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); |
| 122 | 126 |
| 123 bool flipped() const { return flipped_; } | 127 bool flipped() const { return flipped_; } |
| 124 gfx::Size size() const { return size_; } | 128 gfx::Size size() const { return size_; } |
| 125 float device_scale_factor() const { return device_scale_factor_; } | 129 float device_scale_factor() const { return device_scale_factor_; } |
| 126 | 130 |
| 127 virtual unsigned int PrepareTexture() = 0; | 131 virtual unsigned int PrepareTexture() = 0; |
| 128 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; | 132 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; |
| 129 | 133 |
| 130 // Replaces the texture with the texture from the specified mailbox. | 134 // Replaces the texture with the texture from the specified mailbox. |
| 131 virtual void Consume(const std::string& mailbox_name, | 135 virtual void Consume(const gpu::Mailbox& mailbox_name, |
| 132 const gfx::Size& new_size) {} | 136 const gfx::Size& new_size) {} |
| 133 | 137 |
| 134 // Moves the texture into the mailbox and returns the mailbox name. | 138 // Moves the texture into the mailbox and returns the mailbox name. |
| 135 // The texture must have been previously consumed from a mailbox. | 139 // The texture must have been previously consumed from a mailbox. |
| 136 virtual std::string Produce(); | 140 virtual gpu::Mailbox Produce(); |
| 137 | 141 |
| 138 protected: | 142 protected: |
| 139 virtual ~Texture(); | 143 virtual ~Texture(); |
| 140 gfx::Size size_; // in pixel | 144 gfx::Size size_; // in pixel |
| 141 | 145 |
| 142 private: | 146 private: |
| 143 friend class base::RefCounted<Texture>; | 147 friend class base::RefCounted<Texture>; |
| 144 | 148 |
| 145 bool flipped_; | 149 bool flipped_; |
| 146 float device_scale_factor_; | 150 float device_scale_factor_; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 bool disable_schedule_composite_; | 338 bool disable_schedule_composite_; |
| 335 | 339 |
| 336 CompositorLock* compositor_lock_; | 340 CompositorLock* compositor_lock_; |
| 337 | 341 |
| 338 DISALLOW_COPY_AND_ASSIGN(Compositor); | 342 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 339 }; | 343 }; |
| 340 | 344 |
| 341 } // namespace ui | 345 } // namespace ui |
| 342 | 346 |
| 343 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 347 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |