Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: content/common/gpu/client/gl_helper.h

Issue 132233041: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ff7262fa Rebase. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/cc_messages_unittest.cc ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "third_party/skia/include/core/SkBitmap.h" 15 #include "third_party/skia/include/core/SkBitmap.h"
15 16
16 namespace gfx { 17 namespace gfx {
17 class Rect; 18 class Rect;
18 class Size; 19 class Size;
19 } 20 }
20 21
21 namespace gpu { 22 namespace gpu {
22 class ContextSupport; 23 class ContextSupport;
23 struct Mailbox; 24 struct Mailbox;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // Simply creates a texture. 249 // Simply creates a texture.
249 GLuint CreateTexture(); 250 GLuint CreateTexture();
250 // Deletes a texture. 251 // Deletes a texture.
251 void DeleteTexture(GLuint texture_id); 252 void DeleteTexture(GLuint texture_id);
252 253
253 // Insert a sync point into the GL command buffer. 254 // Insert a sync point into the GL command buffer.
254 uint32 InsertSyncPoint(); 255 uint32 InsertSyncPoint();
255 // Wait for the sync point before executing further GL commands. 256 // Wait for the sync point before executing further GL commands.
256 void WaitSyncPoint(uint32 sync_point); 257 void WaitSyncPoint(uint32 sync_point);
257 258
258 // Creates a mailbox that is attached to the given texture id, and a sync 259 // Creates a mailbox holder that is attached to the given texture id, with a
259 // point to wait on before using the mailbox. Returns an empty mailbox on 260 // sync point to wait on before using the mailbox. Returns a holder with an
260 // failure. 261 // empty mailbox on failure.
261 // Note the texture is assumed to be GL_TEXTURE_2D. 262 // Note the texture is assumed to be GL_TEXTURE_2D.
262 gpu::Mailbox ProduceMailboxFromTexture(GLuint texture_id, uint32* sync_point); 263 gpu::MailboxHolder ProduceMailboxHolderFromTexture(GLuint texture_id);
263 264
264 // Creates a texture and consumes a mailbox into it. Returns 0 on failure. 265 // Creates a texture and consumes a mailbox into it. Returns 0 on failure.
265 // Note the mailbox is assumed to be GL_TEXTURE_2D. 266 // Note the mailbox is assumed to be GL_TEXTURE_2D.
266 GLuint ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, 267 GLuint ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
267 uint32 sync_point); 268 uint32 sync_point);
268 269
269 // Resizes the texture's size to |size|. 270 // Resizes the texture's size to |size|.
270 void ResizeTexture(GLuint texture, const gfx::Size& size); 271 void ResizeTexture(GLuint texture, const gfx::Size& size);
271 272
272 // Copies the framebuffer data given in |rect| to |texture|. 273 // Copies the framebuffer data given in |rect| to |texture|.
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, 362 virtual void ReadbackYUV(const gpu::Mailbox& mailbox,
362 uint32 sync_point, 363 uint32 sync_point,
363 const scoped_refptr<media::VideoFrame>& target, 364 const scoped_refptr<media::VideoFrame>& target,
364 const base::Callback<void(bool)>& callback) = 0; 365 const base::Callback<void(bool)>& callback) = 0;
365 virtual GLHelper::ScalerInterface* scaler() = 0; 366 virtual GLHelper::ScalerInterface* scaler() = 0;
366 }; 367 };
367 368
368 } // namespace content 369 } // namespace content
369 370
370 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ 371 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_
OLDNEW
« no previous file with comments | « content/common/cc_messages_unittest.cc ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698