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 "webkit/common/gpu/webgraphicscontext3d_impl.h" | 5 #include "gpu/blink/webgraphicscontext3d_impl.h" |
6 | 6 |
7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "gpu/GLES2/gl2extchromium.h" | 10 #include "gpu/GLES2/gl2extchromium.h" |
11 #include "gpu/command_buffer/client/gles2_implementation.h" | 11 #include "gpu/command_buffer/client/gles2_implementation.h" |
12 #include "gpu/command_buffer/client/gles2_lib.h" | 12 #include "gpu/command_buffer/client/gles2_lib.h" |
13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 13 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
14 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" | 14 #include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h" |
15 | 15 |
16 #include "third_party/khronos/GLES2/gl2.h" | 16 #include "third_party/khronos/GLES2/gl2.h" |
17 #ifndef GL_GLEXT_PROTOTYPES | 17 #ifndef GL_GLEXT_PROTOTYPES |
18 #define GL_GLEXT_PROTOTYPES 1 | 18 #define GL_GLEXT_PROTOTYPES 1 |
19 #endif | 19 #endif |
20 #include "third_party/khronos/GLES2/gl2ext.h" | 20 #include "third_party/khronos/GLES2/gl2ext.h" |
21 | 21 |
22 namespace webkit { | 22 namespace gpu_blink { |
23 namespace gpu { | |
24 | 23 |
25 namespace { | 24 namespace { |
26 | 25 |
27 uint32_t GenFlushID() { | 26 uint32_t GenFlushID() { |
28 static base::subtle::Atomic32 flush_id = 0; | 27 static base::subtle::Atomic32 flush_id = 0; |
29 | 28 |
30 base::subtle::Atomic32 my_id = base::subtle::Barrier_AtomicIncrement( | 29 base::subtle::Atomic32 my_id = base::subtle::Barrier_AtomicIncrement( |
31 &flush_id, 1); | 30 &flush_id, 1); |
32 return static_cast<uint32_t>(my_id); | 31 return static_cast<uint32_t>(my_id); |
33 } | 32 } |
34 | 33 |
35 } // namespace anonymous | 34 } // namespace |
36 | 35 |
37 class WebGraphicsContext3DErrorMessageCallback | 36 class WebGraphicsContext3DErrorMessageCallback |
38 : public ::gpu::gles2::GLES2ImplementationErrorMessageCallback { | 37 : public ::gpu::gles2::GLES2ImplementationErrorMessageCallback { |
39 public: | 38 public: |
40 WebGraphicsContext3DErrorMessageCallback( | 39 WebGraphicsContext3DErrorMessageCallback( |
41 WebGraphicsContext3DImpl* context) | 40 WebGraphicsContext3DImpl* context) |
42 : graphics_context_(context) { | 41 : graphics_context_(context) { |
43 } | 42 } |
44 | 43 |
45 virtual void OnErrorMessage(const char* msg, int id) override; | 44 virtual void OnErrorMessage(const char* msg, int id) override; |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 output_attribs->alpha_size = attributes.alpha ? 8 : 0; | 1020 output_attribs->alpha_size = attributes.alpha ? 8 : 0; |
1022 output_attribs->depth_size = attributes.depth ? 24 : 0; | 1021 output_attribs->depth_size = attributes.depth ? 24 : 0; |
1023 output_attribs->stencil_size = attributes.stencil ? 8 : 0; | 1022 output_attribs->stencil_size = attributes.stencil ? 8 : 0; |
1024 output_attribs->samples = attributes.antialias ? 4 : 0; | 1023 output_attribs->samples = attributes.antialias ? 4 : 0; |
1025 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; | 1024 output_attribs->sample_buffers = attributes.antialias ? 1 : 0; |
1026 output_attribs->fail_if_major_perf_caveat = | 1025 output_attribs->fail_if_major_perf_caveat = |
1027 attributes.failIfMajorPerformanceCaveat; | 1026 attributes.failIfMajorPerformanceCaveat; |
1028 output_attribs->bind_generates_resource = false; | 1027 output_attribs->bind_generates_resource = false; |
1029 } | 1028 } |
1030 | 1029 |
1031 } // namespace gpu | 1030 } // namespace gpu_blink |
1032 } // namespace webkit | |
OLD | NEW |