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 CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
7 | 7 |
8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "gpu/command_buffer/client/gles2_interface.h" | 13 #include "gpu/command_buffer/client/gles2_interface.h" |
| 14 #include "gpu/command_buffer/common/mailbox_holder.h" |
14 | 15 |
15 namespace gfx { | 16 namespace gfx { |
16 class Rect; | 17 class Rect; |
17 class Size; | 18 class Size; |
18 } | 19 } |
19 | 20 |
20 namespace gpu { | 21 namespace gpu { |
21 class ContextSupport; | 22 class ContextSupport; |
22 struct Mailbox; | 23 struct Mailbox; |
23 } | 24 } |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // Simply creates a texture. | 239 // Simply creates a texture. |
239 GLuint CreateTexture(); | 240 GLuint CreateTexture(); |
240 // Deletes a texture. | 241 // Deletes a texture. |
241 void DeleteTexture(GLuint texture_id); | 242 void DeleteTexture(GLuint texture_id); |
242 | 243 |
243 // Insert a sync point into the GL command buffer. | 244 // Insert a sync point into the GL command buffer. |
244 uint32 InsertSyncPoint(); | 245 uint32 InsertSyncPoint(); |
245 // Wait for the sync point before executing further GL commands. | 246 // Wait for the sync point before executing further GL commands. |
246 void WaitSyncPoint(uint32 sync_point); | 247 void WaitSyncPoint(uint32 sync_point); |
247 | 248 |
248 // Creates a mailbox that is attached to the given texture id, and a sync | 249 // Creates a mailbox holder that is attached to the given texture id, with a |
249 // point to wait on before using the mailbox. Returns an empty mailbox on | 250 // sync point to wait on before using the mailbox. Returns a holder with an |
250 // failure. | 251 // empty mailbox on failure. |
251 // Note the texture is assumed to be GL_TEXTURE_2D. | 252 // Note the texture is assumed to be GL_TEXTURE_2D. |
252 gpu::Mailbox ProduceMailboxFromTexture(GLuint texture_id, uint32* sync_point); | 253 gpu::MailboxHolder ProduceMailboxHolderFromTexture(GLuint texture_id); |
253 | 254 |
254 // Creates a texture and consumes a mailbox into it. Returns 0 on failure. | 255 // Creates a texture and consumes a mailbox into it. Returns 0 on failure. |
255 // Note the mailbox is assumed to be GL_TEXTURE_2D. | 256 // Note the mailbox is assumed to be GL_TEXTURE_2D. |
256 GLuint ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, | 257 GLuint ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, |
257 uint32 sync_point); | 258 uint32 sync_point); |
258 | 259 |
259 // Resizes the texture's size to |size|. | 260 // Resizes the texture's size to |size|. |
260 void ResizeTexture(GLuint texture, const gfx::Size& size); | 261 void ResizeTexture(GLuint texture, const gfx::Size& size); |
261 | 262 |
262 // Copies the framebuffer data given in |rect| to |texture|. | 263 // Copies the framebuffer data given in |rect| to |texture|. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, | 347 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, |
347 uint32 sync_point, | 348 uint32 sync_point, |
348 const scoped_refptr<media::VideoFrame>& target, | 349 const scoped_refptr<media::VideoFrame>& target, |
349 const base::Callback<void(bool)>& callback) = 0; | 350 const base::Callback<void(bool)>& callback) = 0; |
350 virtual GLHelper::ScalerInterface* scaler() = 0; | 351 virtual GLHelper::ScalerInterface* scaler() = 0; |
351 }; | 352 }; |
352 | 353 |
353 } // namespace content | 354 } // namespace content |
354 | 355 |
355 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 356 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
OLD | NEW |