OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
6 | 6 |
7 #include "third_party/khronos/GLES2/gl2.h" | 7 #include "third_party/khronos/GLES2/gl2.h" |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
11 #include "third_party/khronos/GLES2/gl2ext.h" | 11 #include "third_party/khronos/GLES2/gl2ext.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <set> | 14 #include <set> |
15 | 15 |
16 #include "base/bind.h" | 16 #include "base/bind.h" |
17 #include "base/lazy_instance.h" | |
18 #include "base/command_line.h" | 17 #include "base/command_line.h" |
19 #include "base/debug/trace_event.h" | 18 #include "base/debug/trace_event.h" |
| 19 #include "base/lazy_instance.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/message_loop.h" | 21 #include "base/message_loop.h" |
22 #include "base/metrics/field_trial.h" | 22 #include "base/metrics/field_trial.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/gpu/client/gpu_channel_host.h" |
25 #include "content/common/gpu/gpu_memory_allocation.h" | 26 #include "content/common/gpu/gpu_memory_allocation.h" |
26 #include "content/common/gpu/client/gpu_channel_host.h" | |
27 #include "content/common/gpu/gpu_process_launch_causes.h" | 27 #include "content/common/gpu/gpu_process_launch_causes.h" |
28 #include "content/public/common/content_constants.h" | 28 #include "content/public/common/content_constants.h" |
29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
30 #include "gpu/GLES2/gl2extchromium.h" | 30 #include "gpu/GLES2/gl2extchromium.h" |
31 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 31 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
32 #include "gpu/command_buffer/client/gles2_implementation.h" | 32 #include "gpu/command_buffer/client/gles2_implementation.h" |
33 #include "gpu/command_buffer/client/gles2_lib.h" | 33 #include "gpu/command_buffer/client/gles2_lib.h" |
34 #include "gpu/command_buffer/client/gles2_trace_implementation.h" | 34 #include "gpu/command_buffer/client/gles2_trace_implementation.h" |
35 #include "gpu/command_buffer/client/transfer_buffer.h" | 35 #include "gpu/command_buffer/client/transfer_buffer.h" |
36 #include "gpu/command_buffer/common/constants.h" | 36 #include "gpu/command_buffer/common/constants.h" |
37 #include "gpu/command_buffer/common/mailbox.h" | 37 #include "gpu/command_buffer/common/mailbox.h" |
38 #include "gpu/ipc/command_buffer_proxy.h" | 38 #include "gpu/ipc/command_buffer_proxy.h" |
39 #include "third_party/skia/include/core/SkTypes.h" | 39 #include "third_party/skia/include/core/SkTypes.h" |
40 #include "webkit/gpu/gl_bindings_skia_cmd_buffer.h" | 40 #include "webkit/common/gpu/gl_bindings_skia_cmd_buffer.h" |
41 | 41 |
42 namespace content { | 42 namespace content { |
43 static base::LazyInstance<base::Lock>::Leaky | 43 static base::LazyInstance<base::Lock>::Leaky |
44 g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; | 44 g_all_shared_contexts_lock = LAZY_INSTANCE_INITIALIZER; |
45 static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > | 45 static base::LazyInstance<std::set<WebGraphicsContext3DCommandBufferImpl*> > |
46 g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; | 46 g_all_shared_contexts = LAZY_INSTANCE_INITIALIZER; |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 void ClearSharedContextsIfInShareSet( | 50 void ClearSharedContextsIfInShareSet( |
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 | 1739 |
1740 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1740 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1741 const std::string& message, int id) { | 1741 const std::string& message, int id) { |
1742 if (error_message_callback_) { | 1742 if (error_message_callback_) { |
1743 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1743 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1744 error_message_callback_->onErrorMessage(str, id); | 1744 error_message_callback_->onErrorMessage(str, id); |
1745 } | 1745 } |
1746 } | 1746 } |
1747 | 1747 |
1748 } // namespace content | 1748 } // namespace content |
OLD | NEW |