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

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: rebase 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 ae4bb37c12877e341511763ab8f85d88920714b7..204893e8d3786a8609cc17df59967b2fcd1a7263 100644
--- a/content/browser/renderer_host/image_transport_factory.cc
+++ b/content/browser/renderer_host/image_transport_factory.cc
@@ -167,32 +167,23 @@ 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())
- return;
-
DCHECK(host_context_ && texture_id_);
+ mailbox_name_ = mailbox_name;
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()) {
- 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);
- }
+ virtual gpu::Mailbox Produce() OVERRIDE {
+ DCHECK(!mailbox_name_.IsZero());
+ DCHECK(host_context_ && texture_id_);
+ host_context_->bindTexture(GL_TEXTURE_2D, texture_id_);
+ host_context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name_.name);
+ gpu::Mailbox name;
+ std::swap(mailbox_name_, name);
return name;
}
@@ -200,7 +191,7 @@ class ImageTransportClientTexture : public OwnedTexture {
virtual ~ImageTransportClientTexture() {}
private:
- std::string mailbox_name_;
+ gpu::Mailbox mailbox_name_;
DISALLOW_COPY_AND_ASSIGN(ImageTransportClientTexture);
};
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.cc ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698