OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (!render_thread) | 56 if (!render_thread) |
57 return false; | 57 return false; |
58 GpuChannelHost* host = render_thread->EstablishGpuChannelSync(); | 58 GpuChannelHost* host = render_thread->EstablishGpuChannelSync(); |
59 if (!host) | 59 if (!host) |
60 return false; | 60 return false; |
61 DCHECK(host->ready()); | 61 DCHECK(host->ready()); |
62 context_ = ggl::CreateOffscreenContext(host, parent_context, gfx::Size(1, 1)); | 62 context_ = ggl::CreateOffscreenContext(host, parent_context, gfx::Size(1, 1)); |
63 if (!context_) | 63 if (!context_) |
64 return false; | 64 return false; |
65 // TODO(gman): Remove this. | 65 // TODO(gman): Remove this. |
66 DisableShaderTranslation(context_); | 66 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 67 if (!command_line.HasSwitch(switches::kEnableGLSLTranslator)) { |
| 68 DisableShaderTranslation(context_); |
| 69 } |
67 return true; | 70 return true; |
68 } | 71 } |
69 | 72 |
70 bool WebGraphicsContext3DCommandBufferImpl::makeContextCurrent() { | 73 bool WebGraphicsContext3DCommandBufferImpl::makeContextCurrent() { |
71 return ggl::MakeCurrent(context_); | 74 return ggl::MakeCurrent(context_); |
72 } | 75 } |
73 | 76 |
74 int WebGraphicsContext3DCommandBufferImpl::width() { | 77 int WebGraphicsContext3DCommandBufferImpl::width() { |
75 return cached_width_; | 78 return cached_width_; |
76 } | 79 } |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 glDeleteShader(shader); | 835 glDeleteShader(shader); |
833 } | 836 } |
834 | 837 |
835 void WebGraphicsContext3DCommandBufferImpl::deleteTexture(unsigned texture) { | 838 void WebGraphicsContext3DCommandBufferImpl::deleteTexture(unsigned texture) { |
836 makeContextCurrent(); | 839 makeContextCurrent(); |
837 glDeleteTextures(1, &texture); | 840 glDeleteTextures(1, &texture); |
838 } | 841 } |
839 | 842 |
840 #endif // defined(ENABLE_GPU) | 843 #endif // defined(ENABLE_GPU) |
841 | 844 |
OLD | NEW |