| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/image_transport_factory.h" | 5 #include "content/browser/renderer_host/image_transport_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 mailbox_name_ = mailbox_name; | 164 mailbox_name_ = mailbox_name; |
| 165 if (mailbox_name.empty()) | 165 if (mailbox_name.empty()) |
| 166 return; | 166 return; |
| 167 | 167 |
| 168 DCHECK(host_context_ && texture_id_); | 168 DCHECK(host_context_ && texture_id_); |
| 169 host_context_->bindTexture(GL_TEXTURE_2D, texture_id_); | 169 host_context_->bindTexture(GL_TEXTURE_2D, texture_id_); |
| 170 host_context_->consumeTextureCHROMIUM( | 170 host_context_->consumeTextureCHROMIUM( |
| 171 GL_TEXTURE_2D, | 171 GL_TEXTURE_2D, |
| 172 reinterpret_cast<const signed char*>(mailbox_name.c_str())); | 172 reinterpret_cast<const signed char*>(mailbox_name.c_str())); |
| 173 size_ = new_size; | 173 size_ = new_size; |
| 174 host_context_->flush(); | 174 host_context_->shallowFlushCHROMIUM(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 virtual std::string Produce() OVERRIDE { | 177 virtual std::string Produce() OVERRIDE { |
| 178 std::string name; | 178 std::string name; |
| 179 if (!mailbox_name_.empty()) { | 179 if (!mailbox_name_.empty()) { |
| 180 DCHECK(host_context_ && texture_id_); | 180 DCHECK(host_context_ && texture_id_); |
| 181 host_context_->bindTexture(GL_TEXTURE_2D, texture_id_); | 181 host_context_->bindTexture(GL_TEXTURE_2D, texture_id_); |
| 182 host_context_->produceTextureCHROMIUM( | 182 host_context_->produceTextureCHROMIUM( |
| 183 GL_TEXTURE_2D, | 183 GL_TEXTURE_2D, |
| 184 reinterpret_cast<const signed char*>(mailbox_name_.c_str())); | 184 reinterpret_cast<const signed char*>(mailbox_name_.c_str())); |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 delete g_factory; | 636 delete g_factory; |
| 637 g_factory = NULL; | 637 g_factory = NULL; |
| 638 } | 638 } |
| 639 | 639 |
| 640 // static | 640 // static |
| 641 ImageTransportFactory* ImageTransportFactory::GetInstance() { | 641 ImageTransportFactory* ImageTransportFactory::GetInstance() { |
| 642 return g_factory; | 642 return g_factory; |
| 643 } | 643 } |
| 644 | 644 |
| 645 } // namespace content | 645 } // namespace content |
| OLD | NEW |