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 ContextProviderFromContextFactory; | 50 class ContextProviderFromContextFactory; |
47 class Layer; | 51 class Layer; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); | 147 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); |
144 | 148 |
145 bool flipped() const { return flipped_; } | 149 bool flipped() const { return flipped_; } |
146 gfx::Size size() const { return size_; } | 150 gfx::Size size() const { return size_; } |
147 float device_scale_factor() const { return device_scale_factor_; } | 151 float device_scale_factor() const { return device_scale_factor_; } |
148 | 152 |
149 virtual unsigned int PrepareTexture() = 0; | 153 virtual unsigned int PrepareTexture() = 0; |
150 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; | 154 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; |
151 | 155 |
152 // Replaces the texture with the texture from the specified mailbox. | 156 // Replaces the texture with the texture from the specified mailbox. |
153 virtual void Consume(const std::string& mailbox_name, | 157 virtual void Consume(const gpu::Mailbox& mailbox_name, |
154 const gfx::Size& new_size) {} | 158 const gfx::Size& new_size) {} |
155 | 159 |
156 // Moves the texture into the mailbox and returns the mailbox name. | 160 // Moves the texture into the mailbox and returns the mailbox name. |
157 // The texture must have been previously consumed from a mailbox. | 161 // The texture must have been previously consumed from a mailbox. |
158 virtual std::string Produce(); | 162 virtual gpu::Mailbox Produce(); |
159 | 163 |
160 protected: | 164 protected: |
161 virtual ~Texture(); | 165 virtual ~Texture(); |
162 gfx::Size size_; // in pixel | 166 gfx::Size size_; // in pixel |
163 | 167 |
164 private: | 168 private: |
165 friend class base::RefCounted<Texture>; | 169 friend class base::RefCounted<Texture>; |
166 | 170 |
167 bool flipped_; | 171 bool flipped_; |
168 float device_scale_factor_; | 172 float device_scale_factor_; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 bool disable_schedule_composite_; | 360 bool disable_schedule_composite_; |
357 | 361 |
358 CompositorLock* compositor_lock_; | 362 CompositorLock* compositor_lock_; |
359 | 363 |
360 DISALLOW_COPY_AND_ASSIGN(Compositor); | 364 DISALLOW_COPY_AND_ASSIGN(Compositor); |
361 }; | 365 }; |
362 | 366 |
363 } // namespace ui | 367 } // namespace ui |
364 | 368 |
365 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 369 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |