| 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_android.h" | 5 #include "content/browser/renderer_host/image_transport_factory_android.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 10 #include "content/common/gpu/client/gl_helper.h" | 10 #include "content/common/gpu/client/gl_helper.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 void CmdBufferImageTransportFactory::AcquireTexture( | 135 void CmdBufferImageTransportFactory::AcquireTexture( |
| 136 uint32 texture_id, const signed char* mailbox_name) { | 136 uint32 texture_id, const signed char* mailbox_name) { |
| 137 if (!context_->makeContextCurrent()) { | 137 if (!context_->makeContextCurrent()) { |
| 138 LOG(ERROR) << "Failed to make helper context current."; | 138 LOG(ERROR) << "Failed to make helper context current."; |
| 139 return; | 139 return; |
| 140 } | 140 } |
| 141 context_->bindTexture(GL_TEXTURE_2D, texture_id); | 141 context_->bindTexture(GL_TEXTURE_2D, texture_id); |
| 142 context_->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name); | 142 context_->consumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox_name); |
| 143 context_->flush(); | 143 context_->shallowFlushCHROMIUM(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 GLHelper* CmdBufferImageTransportFactory::GetGLHelper() { | 146 GLHelper* CmdBufferImageTransportFactory::GetGLHelper() { |
| 147 if (!gl_helper_) | 147 if (!gl_helper_) |
| 148 gl_helper_.reset(new GLHelper(context_->GetImplementation(), | 148 gl_helper_.reset(new GLHelper(context_->GetImplementation(), |
| 149 context_->GetContextSupport())); | 149 context_->GetContextSupport())); |
| 150 | 150 |
| 151 return gl_helper_.get(); | 151 return gl_helper_.get(); |
| 152 } | 152 } |
| 153 | 153 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 void GLContextLostListener::DidLoseContext() { | 188 void GLContextLostListener::DidLoseContext() { |
| 189 delete g_factory; | 189 delete g_factory; |
| 190 g_factory = NULL; | 190 g_factory = NULL; |
| 191 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, | 191 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, |
| 192 g_factory_observers.Get(), | 192 g_factory_observers.Get(), |
| 193 OnLostResources()); | 193 OnLostResources()); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace content | 196 } // namespace content |
| OLD | NEW |