| 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/memory/singleton.h" | 8 #include "base/memory/singleton.h" | 
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" | 
| 10 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 10 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 121       kBytesPerPixel; | 121       kBytesPerPixel; | 
| 122   context_->setContextLostCallback(context_lost_listener_.get()); | 122   context_->setContextLostCallback(context_lost_listener_.get()); | 
| 123   context_->Initialize( | 123   context_->Initialize( | 
| 124       attrs, | 124       attrs, | 
| 125       false, | 125       false, | 
| 126       CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE, | 126       CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE, | 
| 127       64 * 1024,  // command buffer size | 127       64 * 1024,  // command buffer size | 
| 128       64 * 1024,  // starting buffer size | 128       64 * 1024,  // starting buffer size | 
| 129       64 * 1024,  // min buffer size | 129       64 * 1024,  // min buffer size | 
| 130       std::min(3 * full_screen_texture_size_in_bytes, | 130       std::min(3 * full_screen_texture_size_in_bytes, | 
| 131                kDefaultMaxTransferBufferSize)); | 131                kDefaultMaxTransferBufferSize), | 
|  | 132       64 * 1024   // mapped memory limit | 
|  | 133   ); | 
| 132 | 134 | 
| 133   if (context_->makeContextCurrent()) | 135   if (context_->makeContextCurrent()) | 
| 134     context_->pushGroupMarkerEXT( | 136     context_->pushGroupMarkerEXT( | 
| 135         base::StringPrintf("CmdBufferImageTransportFactory-%p", | 137         base::StringPrintf("CmdBufferImageTransportFactory-%p", | 
| 136                            context_.get()).c_str()); | 138                            context_.get()).c_str()); | 
| 137 } | 139 } | 
| 138 | 140 | 
| 139 CmdBufferImageTransportFactory::~CmdBufferImageTransportFactory() { | 141 CmdBufferImageTransportFactory::~CmdBufferImageTransportFactory() { | 
| 140   context_->setContextLostCallback(NULL); | 142   context_->setContextLostCallback(NULL); | 
| 141 } | 143 } | 
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 230 | 232 | 
| 231 void GLContextLostListener::DidLoseContext() { | 233 void GLContextLostListener::DidLoseContext() { | 
| 232   delete g_factory; | 234   delete g_factory; | 
| 233   g_factory = NULL; | 235   g_factory = NULL; | 
| 234   FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, | 236   FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, | 
| 235       g_factory_observers.Get(), | 237       g_factory_observers.Get(), | 
| 236       OnLostResources()); | 238       OnLostResources()); | 
| 237 } | 239 } | 
| 238 | 240 | 
| 239 } // namespace content | 241 } // namespace content | 
| OLD | NEW | 
|---|