diff options
Diffstat (limited to 'content/common/gpu')
-rw-r--r-- | content/common/gpu/client/gl_helper.cc | 14 | ||||
-rw-r--r-- | content/common/gpu/client/gl_helper.h | 9 |
2 files changed, 11 insertions, 12 deletions
diff --git a/content/common/gpu/client/gl_helper.cc b/content/common/gpu/client/gl_helper.cc index 3b7e23a..13d2913 100644 --- a/content/common/gpu/client/gl_helper.cc +++ b/content/common/gpu/client/gl_helper.cc @@ -19,6 +19,7 @@ #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/common/mailbox.h" +#include "gpu/command_buffer/common/mailbox_holder.h" #include "media/base/video_frame.h" #include "media/base/video_util.h" #include "third_party/skia/include/core/SkRegion.h" @@ -670,18 +671,15 @@ void GLHelper::WaitSyncPoint(uint32 sync_point) { gl_->WaitSyncPointCHROMIUM(sync_point); } -gpu::Mailbox GLHelper::ProduceMailboxFromTexture(GLuint texture_id, - uint32* sync_point) { +gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture( + GLuint texture_id) { gpu::Mailbox mailbox; gl_->GenMailboxCHROMIUM(mailbox.name); - if (mailbox.IsZero()) { - *sync_point = 0; - return mailbox; - } + if (mailbox.IsZero()) + return gpu::MailboxHolder(); content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(gl_, texture_id); gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); - *sync_point = InsertSyncPoint(); - return mailbox; + return gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, InsertSyncPoint()); } GLuint GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, diff --git a/content/common/gpu/client/gl_helper.h b/content/common/gpu/client/gl_helper.h index 90e9b71..7b53268 100644 --- a/content/common/gpu/client/gl_helper.h +++ b/content/common/gpu/client/gl_helper.h @@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" #include "gpu/command_buffer/client/gles2_interface.h" +#include "gpu/command_buffer/common/mailbox_holder.h" namespace gfx { class Rect; @@ -245,11 +246,11 @@ class CONTENT_EXPORT GLHelper { // Wait for the sync point before executing further GL commands. void WaitSyncPoint(uint32 sync_point); - // Creates a mailbox that is attached to the given texture id, and a sync - // point to wait on before using the mailbox. Returns an empty mailbox on - // failure. + // Creates a mailbox holder that is attached to the given texture id, with a + // sync point to wait on before using the mailbox. Returns a holder with an + // empty mailbox on failure. // Note the texture is assumed to be GL_TEXTURE_2D. - gpu::Mailbox ProduceMailboxFromTexture(GLuint texture_id, uint32* sync_point); + gpu::MailboxHolder ProduceMailboxHolderFromTexture(GLuint texture_id); // Creates a texture and consumes a mailbox into it. Returns 0 on failure. // Note the mailbox is assumed to be GL_TEXTURE_2D. |