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

Unified Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 9667012: Fix --single-process mode issues with GpuChannelHostFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index ea5f90d78151db78e0026a1ef679b03d66b1bf18..9b7bc46283b5cce1fb2900dd263dfb6798b7bd36 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -48,8 +48,10 @@ void ClearSharedContexts() {
WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
int surface_id,
const GURL& active_url,
+ GpuChannelHostFactory* factory,
const base::WeakPtr<WebGraphicsContext3DSwapBuffersClient>& swap_client)
: initialize_failed_(false),
+ factory_(factory),
context_(NULL),
gl_(NULL),
host_(NULL),
@@ -88,8 +90,7 @@ bool WebGraphicsContext3DCommandBufferImpl::Initialize(
const WebGraphicsContext3D::Attributes& attributes) {
DCHECK(!context_);
TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::initialize");
- GpuChannelHostFactory* factory = GpuChannelHostFactory::instance();
- if (!factory)
+ if (!factory_)
return false;
// The noExtensions and canRecoverFromContextLoss flags are
@@ -102,7 +103,7 @@ bool WebGraphicsContext3DCommandBufferImpl::Initialize(
// Note similar code in Pepper PlatformContext3DImpl::Init.
do {
- host_ = factory->EstablishGpuChannelSync(
+ host_ = factory_->EstablishGpuChannelSync(
content::
CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE);
if (!host_)
@@ -1116,8 +1117,7 @@ void WebGraphicsContext3DCommandBufferImpl::deleteTexture(WebGLId texture) {
}
bool WebGraphicsContext3DCommandBufferImpl::ShouldUseSwapClient() {
- GpuChannelHostFactory* factory = GpuChannelHostFactory::instance();
- return factory && factory->IsMainThread() && swap_client_.get();
+ return factory_ && factory_->IsMainThread() && swap_client_.get();
}
void WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete() {
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | content/common/webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698