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

Unified Diff: content/browser/renderer_host/image_transport_factory.cc

Issue 12440005: Use gpu::Mailbox in IPCs instead of std::string (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/renderer_host/image_transport_factory.cc
diff --git a/content/browser/renderer_host/image_transport_factory.cc b/content/browser/renderer_host/image_transport_factory.cc
index e37ea28433836bb2acf8f625fbb23bb29a6d30d5..48038fb0bc37a492c8c2595c8fbd4b5d7528b331 100644
--- a/content/browser/renderer_host/image_transport_factory.cc
+++ b/content/browser/renderer_host/image_transport_factory.cc
@@ -162,31 +162,26 @@ class ImageTransportClientTexture : public OwnedTexture {
host_context->createTexture()) {
}
- virtual void Consume(const std::string& mailbox_name,
+ virtual void Consume(const gpu::Mailbox& mailbox_name,
const gfx::Size& new_size) OVERRIDE {
- DCHECK(mailbox_name.size() == GL_MAILBOX_SIZE_CHROMIUM);
mailbox_name_ = mailbox_name;
- if (mailbox_name.empty())
+ if (mailbox_name.IsZero())
no sievers 2013/03/06 23:19:23 I guess you could remove that now, since it's alre
piman 2013/03/07 01:48:02 Done.
return;
DCHECK(host_context_ && texture_id_);
host_context_->bindTexture(GL_TEXTURE_2D, texture_id_);
- host_context_->consumeTextureCHROMIUM(
- GL_TEXTURE_2D,
- reinterpret_cast<const signed char*>(mailbox_name.c_str()));
+ host_context_->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name.name);
size_ = new_size;
host_context_->shallowFlushCHROMIUM();
}
- virtual std::string Produce() OVERRIDE {
- std::string name;
- if (!mailbox_name_.empty()) {
+ virtual gpu::Mailbox Produce() OVERRIDE {
+ gpu::Mailbox name;
+ if (!mailbox_name_.IsZero()) {
no sievers 2013/03/06 23:19:23 ...and I think this could be a DCHECK() now since
piman 2013/03/07 01:48:02 Done.
DCHECK(host_context_ && texture_id_);
host_context_->bindTexture(GL_TEXTURE_2D, texture_id_);
- host_context_->produceTextureCHROMIUM(
- GL_TEXTURE_2D,
- reinterpret_cast<const signed char*>(mailbox_name_.c_str()));
- mailbox_name_.swap(name);
+ host_context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name_.name);
+ std::swap(mailbox_name_, name);
}
return name;
}
@@ -195,7 +190,7 @@ class ImageTransportClientTexture : public OwnedTexture {
virtual ~ImageTransportClientTexture() {}
private:
- std::string mailbox_name_;
+ gpu::Mailbox mailbox_name_;
DISALLOW_COPY_AND_ASSIGN(ImageTransportClientTexture);
};

Powered by Google App Engine
This is Rietveld 408576698