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

Unified Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 148003006: Use gpu::Mailbox instead of std:string in IPCs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed typo 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index d72958b4b334dd181ef8defcdaa390fcaf5f6581..6724060519714bf6ef88e17dbe62011d7e7f79e7 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -29,6 +29,7 @@
#include "content/common/gpu/gpu_process_launch_causes.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/mailbox.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/compositor_constants.h"
@@ -113,29 +114,27 @@ class ImageTransportClientTexture : public OwnedTexture {
device_scale_factor,
texture_id) {}
- virtual void Consume(const std::string& mailbox_name,
+ virtual void Consume(const gpu::Mailbox& mailbox,
const gfx::Size& new_size) OVERRIDE {
- DCHECK(mailbox_name.size() == GL_MAILBOX_SIZE_CHROMIUM);
- mailbox_name_ = mailbox_name;
- if (mailbox_name.empty())
+ mailbox_ = mailbox;
+ if (mailbox.IsZero())
return;
DCHECK(provider_ && texture_id_);
GLES2Interface* gl = provider_->ContextGL();
gl->BindTexture(GL_TEXTURE_2D, texture_id_);
- gl->ConsumeTextureCHROMIUM(
- GL_TEXTURE_2D, reinterpret_cast<const GLbyte*>(mailbox_name.c_str()));
+ gl->ConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
size_ = new_size;
gl->ShallowFlushCHROMIUM();
}
- virtual std::string Produce() OVERRIDE { return mailbox_name_; }
+ virtual gpu::Mailbox Produce() OVERRIDE { return mailbox_; }
protected:
virtual ~ImageTransportClientTexture() {}
private:
- std::string mailbox_name_;
+ gpu::Mailbox mailbox_;
DISALLOW_COPY_AND_ASSIGN(ImageTransportClientTexture);
};

Powered by Google App Engine
This is Rietveld 408576698