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

Side by Side Diff: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc

Issue 8352033: Merge 106394 - Fixed bugs with Pepper 3D under dynamic GPU switching. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/912/src/
Patch Set: Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" 7 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h"
8 8
9 #include "gpu/GLES2/gl2.h" 9 #include "gpu/GLES2/gl2.h"
10 #ifndef GL_GLEXT_PROTOTYPES 10 #ifndef GL_GLEXT_PROTOTYPES
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return false; 84 return false;
85 85
86 // The noExtensions and canRecoverFromContextLoss flags are 86 // The noExtensions and canRecoverFromContextLoss flags are
87 // currently used as hints that we are creating a context on 87 // currently used as hints that we are creating a context on
88 // behalf of WebGL or accelerated 2D canvas, respectively. 88 // behalf of WebGL or accelerated 2D canvas, respectively.
89 if (attributes.noExtensions || !attributes.canRecoverFromContextLoss) 89 if (attributes.noExtensions || !attributes.canRecoverFromContextLoss)
90 gpu_preference_ = gfx::PreferDiscreteGpu; 90 gpu_preference_ = gfx::PreferDiscreteGpu;
91 91
92 bool retry = false; 92 bool retry = false;
93 93
94 // Note similar code in Pepper PlatformContext3DImpl::Init.
94 do { 95 do {
95 host_ = render_thread->EstablishGpuChannelSync( 96 host_ = render_thread->EstablishGpuChannelSync(
96 content:: 97 content::
97 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE); 98 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE);
98 if (!host_) 99 if (!host_)
99 return false; 100 return false;
100 DCHECK(host_->state() == GpuChannelHost::kConnected); 101 DCHECK(host_->state() == GpuChannelHost::kConnected);
101 102
102 if (!retry) { 103 if (!retry) {
103 // If the creation of this context requires all contexts for this 104 // If the creation of this context requires all contexts for this
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 if (context_lost_callback_) { 1145 if (context_lost_callback_) {
1145 context_lost_callback_->onContextLost(); 1146 context_lost_callback_->onContextLost();
1146 } 1147 }
1147 RenderViewImpl* renderview = 1148 RenderViewImpl* renderview =
1148 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL; 1149 web_view_ ? RenderViewImpl::FromWebView(web_view_) : NULL;
1149 if (renderview) 1150 if (renderview)
1150 renderview->OnViewContextSwapBuffersAborted(); 1151 renderview->OnViewContextSwapBuffersAborted();
1151 } 1152 }
1152 1153
1153 #endif // defined(ENABLE_GPU) 1154 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/renderer/gpu/renderer_gl_context.cc ('k') | content/renderer/pepper_parent_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698