| OLD | NEW |
| 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 |
| 11 #define GL_GLEXT_PROTOTYPES 1 | 11 #define GL_GLEXT_PROTOTYPES 1 |
| 12 #endif | 12 #endif |
| 13 #include "gpu/GLES2/gl2ext.h" | 13 #include "gpu/GLES2/gl2ext.h" |
| 14 | 14 |
| 15 #include <algorithm> | 15 #include <algorithm> |
| 16 #include <set> | 16 #include <set> |
| 17 | 17 |
| 18 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
| 19 #include "base/string_tokenizer.h" | 19 #include "base/string_tokenizer.h" |
| 20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
| 21 #include "base/debug/trace_event.h" | 21 #include "base/debug/trace_event.h" |
| 22 #include "base/logging.h" | 22 #include "base/logging.h" |
| 23 #include "base/metrics/histogram.h" | 23 #include "base/metrics/histogram.h" |
| 24 #include "base/synchronization/lock.h" | 24 #include "base/synchronization/lock.h" |
| 25 #include "content/common/content_switches.h" | 25 #include "content/common/content_switches.h" |
| 26 #include "content/renderer/gpu/gpu_channel_host.h" | 26 #include "content/renderer/gpu/gpu_channel_host.h" |
| 27 #include "content/renderer/render_thread.h" | 27 #include "content/renderer/render_thread_impl.h" |
| 28 #include "content/renderer/render_view.h" | 28 #include "content/renderer/render_view.h" |
| 29 #include "gpu/command_buffer/client/gles2_implementation.h" | 29 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 30 #include "gpu/command_buffer/common/constants.h" | 30 #include "gpu/command_buffer/common/constants.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 34 #include "webkit/glue/gl_bindings_skia_cmd_buffer.h" | 34 #include "webkit/glue/gl_bindings_skia_cmd_buffer.h" |
| 35 | 35 |
| 36 static base::LazyInstance<base::Lock> | 36 static base::LazyInstance<base::Lock> |
| 37 g_all_shared_contexts_lock(base::LINKER_INITIALIZED); | 37 g_all_shared_contexts_lock(base::LINKER_INITIALIZED); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 65 } | 65 } |
| 66 delete context_; | 66 delete context_; |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool WebGraphicsContext3DCommandBufferImpl::initialize( | 69 bool WebGraphicsContext3DCommandBufferImpl::initialize( |
| 70 WebGraphicsContext3D::Attributes attributes, | 70 WebGraphicsContext3D::Attributes attributes, |
| 71 WebKit::WebView* web_view, | 71 WebKit::WebView* web_view, |
| 72 bool render_directly_to_web_view) { | 72 bool render_directly_to_web_view) { |
| 73 DCHECK(!context_); | 73 DCHECK(!context_); |
| 74 TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::initialize"); | 74 TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::initialize"); |
| 75 RenderThread* render_thread = RenderThread::current(); | 75 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 76 if (!render_thread) | 76 if (!render_thread) |
| 77 return false; | 77 return false; |
| 78 host_ = render_thread->EstablishGpuChannelSync( | 78 host_ = render_thread->EstablishGpuChannelSync( |
| 79 content:: | 79 content:: |
| 80 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE); | 80 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE); |
| 81 if (!host_) | 81 if (!host_) |
| 82 return false; | 82 return false; |
| 83 DCHECK(host_->state() == GpuChannelHost::kConnected); | 83 DCHECK(host_->state() == GpuChannelHost::kConnected); |
| 84 | 84 |
| 85 const GPUInfo& gpu_info = host_->gpu_info(); | 85 const GPUInfo& gpu_info = host_->gpu_info(); |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 } | 1090 } |
| 1091 #ifndef WTF_USE_THREADED_COMPOSITING | 1091 #ifndef WTF_USE_THREADED_COMPOSITING |
| 1092 RenderView* renderview = | 1092 RenderView* renderview = |
| 1093 web_view_ ? RenderView::FromWebView(web_view_) : NULL; | 1093 web_view_ ? RenderView::FromWebView(web_view_) : NULL; |
| 1094 if (renderview) | 1094 if (renderview) |
| 1095 renderview->OnViewContextSwapBuffersAborted(); | 1095 renderview->OnViewContextSwapBuffersAborted(); |
| 1096 #endif | 1096 #endif |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 #endif // defined(ENABLE_GPU) | 1099 #endif // defined(ENABLE_GPU) |
| OLD | NEW |