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

Side by Side Diff: content/browser/renderer_host/image_transport_factory_android.cc

Issue 101223005: Plumbing explicit share groups through context creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 limits.max_transfer_buffer_size = std::min( 81 limits.max_transfer_buffer_size = std::min(
82 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); 82 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize);
83 limits.mapped_memory_reclaim_limit = 83 limits.mapped_memory_reclaim_limit =
84 WebGraphicsContext3DCommandBufferImpl::kNoLimit; 84 WebGraphicsContext3DCommandBufferImpl::kNoLimit;
85 context_.reset( 85 context_.reset(
86 new WebGraphicsContext3DCommandBufferImpl(0, // offscreen 86 new WebGraphicsContext3DCommandBufferImpl(0, // offscreen
87 url, 87 url,
88 gpu_channel_host.get(), 88 gpu_channel_host.get(),
89 attrs, 89 attrs,
90 false, 90 false,
91 limits)); 91 limits,
92 NULL));
92 context_->setContextLostCallback(context_lost_listener_.get()); 93 context_->setContextLostCallback(context_lost_listener_.get());
93 if (context_->makeContextCurrent()) 94 if (context_->makeContextCurrent())
94 context_->pushGroupMarkerEXT( 95 context_->pushGroupMarkerEXT(
95 base::StringPrintf("CmdBufferImageTransportFactory-%p", 96 base::StringPrintf("CmdBufferImageTransportFactory-%p",
96 context_.get()).c_str()); 97 context_.get()).c_str());
97 } 98 }
98 99
99 CmdBufferImageTransportFactory::~CmdBufferImageTransportFactory() { 100 CmdBufferImageTransportFactory::~CmdBufferImageTransportFactory() {
100 context_->setContextLostCallback(NULL); 101 context_->setContextLostCallback(NULL);
101 } 102 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 188
188 void GLContextLostListener::DidLoseContext() { 189 void GLContextLostListener::DidLoseContext() {
189 delete g_factory; 190 delete g_factory;
190 g_factory = NULL; 191 g_factory = NULL;
191 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, 192 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver,
192 g_factory_observers.Get(), 193 g_factory_observers.Get(),
193 OnLostResources()); 194 OnLostResources());
194 } 195 }
195 196
196 } // namespace content 197 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698