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

Unified Diff: content/common/gpu/client/gl_helper.cc

Issue 105743004: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 89bedb8c Reference return. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/gl_helper.cc
diff --git a/content/common/gpu/client/gl_helper.cc b/content/common/gpu/client/gl_helper.cc
index 3ea2557a69dbb970af8e6b656a62001b30e82d50..be778acb40f6a12db4144ede3b8a68efe10e3c5a 100644
--- a/content/common/gpu/client/gl_helper.cc
+++ b/content/common/gpu/client/gl_helper.cc
@@ -18,6 +18,7 @@
#include "content/common/gpu/client/gl_helper_scaling.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/WebKit/public/platform/WebCString.h"
@@ -706,19 +707,17 @@ void GLHelper::WaitSyncPoint(uint32 sync_point) {
context_->waitSyncPoint(sync_point);
}
-gpu::Mailbox GLHelper::ProduceMailboxFromTexture(blink::WebGLId texture_id,
- uint32* sync_point) {
+gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture(
+ blink::WebGLId texture_id) {
gpu::Mailbox mailbox;
context_->genMailboxCHROMIUM(mailbox.name);
- if (mailbox.IsZero()) {
- *sync_point = 0;
- return mailbox;
- }
+ if (mailbox.IsZero())
+ return gpu::MailboxHolder();
content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_,
texture_id);
context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
- *sync_point = context_->insertSyncPoint();
- return mailbox;
+ return gpu::MailboxHolder(
+ mailbox, GL_TEXTURE_2D, context_->insertSyncPoint());
}
blink::WebGLId GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,

Powered by Google App Engine
This is Rietveld 408576698