| 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 22 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |