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

Side by Side Diff: chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc

Issue 2127001: Makes shader translation a runtime switch.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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
« no previous file with comments | « chrome/renderer/ggl/ggl.cc ('k') | gpu/GLES2/gles2_command_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h" 7 #include "chrome/renderer/webgraphicscontext3d_command_buffer_impl.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 10
(...skipping 22 matching lines...) Expand all
33 RenderThread* render_thread = RenderThread::current(); 33 RenderThread* render_thread = RenderThread::current();
34 if (!render_thread) 34 if (!render_thread)
35 return false; 35 return false;
36 GpuChannelHost* host = render_thread->EstablishGpuChannelSync(); 36 GpuChannelHost* host = render_thread->EstablishGpuChannelSync();
37 if (!host) 37 if (!host)
38 return false; 38 return false;
39 DCHECK(host->ready()); 39 DCHECK(host->ready());
40 context_ = ggl::CreateOffscreenContext(host, NULL, gfx::Size(1, 1)); 40 context_ = ggl::CreateOffscreenContext(host, NULL, gfx::Size(1, 1));
41 if (!context_) 41 if (!context_)
42 return false; 42 return false;
43 // TODO(gman): Remove this.
44 DisableShaderTranslation(context_);
43 return true; 45 return true;
44 } 46 }
45 47
46 bool WebGraphicsContext3DCommandBufferImpl::makeContextCurrent() { 48 bool WebGraphicsContext3DCommandBufferImpl::makeContextCurrent() {
47 return ggl::MakeCurrent(context_); 49 return ggl::MakeCurrent(context_);
48 } 50 }
49 51
50 int WebGraphicsContext3DCommandBufferImpl::width() { 52 int WebGraphicsContext3DCommandBufferImpl::width() {
51 return cached_width_; 53 return cached_width_;
52 } 54 }
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 glDeleteShader(shader); 794 glDeleteShader(shader);
793 } 795 }
794 796
795 void WebGraphicsContext3DCommandBufferImpl::deleteTexture(unsigned texture) { 797 void WebGraphicsContext3DCommandBufferImpl::deleteTexture(unsigned texture) {
796 makeContextCurrent(); 798 makeContextCurrent();
797 glDeleteTextures(1, &texture); 799 glDeleteTextures(1, &texture);
798 } 800 }
799 801
800 #endif // defined(ENABLE_GPU) 802 #endif // defined(ENABLE_GPU)
801 803
OLDNEW
« no previous file with comments | « chrome/renderer/ggl/ggl.cc ('k') | gpu/GLES2/gles2_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698