OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file is auto-generated from | 5 // This file is auto-generated from |
6 // ui/gl/generate_bindings.py | 6 // ui/gl/generate_bindings.py |
7 // It's formatted by clang-format using chromium coding style: | 7 // It's formatted by clang-format using chromium coding style: |
8 // clang-format -i -style=chromium filename | 8 // clang-format -i -style=chromium filename |
9 // DO NOT EDIT! | 9 // DO NOT EDIT! |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
14 #include "ui/gl/gl_bindings.h" | 14 #include "ui/gl/gl_bindings.h" |
15 #include "ui/gl/gl_context.h" | 15 #include "ui/gl/gl_context.h" |
16 #include "ui/gl/gl_enums.h" | 16 #include "ui/gl/gl_enums.h" |
17 #include "ui/gl/gl_gl_api_implementation.h" | 17 #include "ui/gl/gl_gl_api_implementation.h" |
18 #include "ui/gl/gl_implementation.h" | 18 #include "ui/gl/gl_implementation.h" |
19 #include "ui/gl/gl_version_info.h" | 19 #include "ui/gl/gl_version_info.h" |
20 | 20 |
21 namespace gfx { | 21 namespace gfx { |
22 | 22 |
23 static bool g_debugBindingsInitialized; | 23 static bool g_debugBindingsInitialized; |
24 DriverGL g_driver_gl; | 24 DriverGL g_driver_gl; |
25 | 25 |
26 void DriverGL::InitializeStaticBindings() { | 26 void DriverGL::InitializeStaticBindings() { |
27 fn.glActiveTextureFn = reinterpret_cast<glActiveTextureProc>( | 27 fn.glActiveTextureFn = reinterpret_cast<glActiveTextureProc>( |
28 GetGLProcAddress("glActiveTexture")); | 28 GetGLProcAddress("glActiveTexture")); |
| 29 fn.glApplyFramebufferAttachmentCMAAINTELFn = 0; |
29 fn.glAttachShaderFn = | 30 fn.glAttachShaderFn = |
30 reinterpret_cast<glAttachShaderProc>(GetGLProcAddress("glAttachShader")); | 31 reinterpret_cast<glAttachShaderProc>(GetGLProcAddress("glAttachShader")); |
31 fn.glBeginQueryFn = 0; | 32 fn.glBeginQueryFn = 0; |
32 fn.glBeginTransformFeedbackFn = 0; | 33 fn.glBeginTransformFeedbackFn = 0; |
33 fn.glBindAttribLocationFn = reinterpret_cast<glBindAttribLocationProc>( | 34 fn.glBindAttribLocationFn = reinterpret_cast<glBindAttribLocationProc>( |
34 GetGLProcAddress("glBindAttribLocation")); | 35 GetGLProcAddress("glBindAttribLocation")); |
35 fn.glBindBufferFn = | 36 fn.glBindBufferFn = |
36 reinterpret_cast<glBindBufferProc>(GetGLProcAddress("glBindBuffer")); | 37 reinterpret_cast<glBindBufferProc>(GetGLProcAddress("glBindBuffer")); |
37 fn.glBindBufferBaseFn = 0; | 38 fn.glBindBufferBaseFn = 0; |
38 fn.glBindBufferRangeFn = 0; | 39 fn.glBindBufferRangeFn = 0; |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 extensions.find("GL_EXT_occlusion_query_boolean ") != std::string::npos; | 522 extensions.find("GL_EXT_occlusion_query_boolean ") != std::string::npos; |
522 ext.b_GL_EXT_robustness = | 523 ext.b_GL_EXT_robustness = |
523 extensions.find("GL_EXT_robustness ") != std::string::npos; | 524 extensions.find("GL_EXT_robustness ") != std::string::npos; |
524 ext.b_GL_EXT_texture_storage = | 525 ext.b_GL_EXT_texture_storage = |
525 extensions.find("GL_EXT_texture_storage ") != std::string::npos; | 526 extensions.find("GL_EXT_texture_storage ") != std::string::npos; |
526 ext.b_GL_EXT_timer_query = | 527 ext.b_GL_EXT_timer_query = |
527 extensions.find("GL_EXT_timer_query ") != std::string::npos; | 528 extensions.find("GL_EXT_timer_query ") != std::string::npos; |
528 ext.b_GL_IMG_multisampled_render_to_texture = | 529 ext.b_GL_IMG_multisampled_render_to_texture = |
529 extensions.find("GL_IMG_multisampled_render_to_texture ") != | 530 extensions.find("GL_IMG_multisampled_render_to_texture ") != |
530 std::string::npos; | 531 std::string::npos; |
| 532 ext.b_GL_INTEL_framebuffer_CMAA = |
| 533 extensions.find("GL_INTEL_framebuffer_CMAA ") != std::string::npos; |
531 ext.b_GL_KHR_blend_equation_advanced = | 534 ext.b_GL_KHR_blend_equation_advanced = |
532 extensions.find("GL_KHR_blend_equation_advanced ") != std::string::npos; | 535 extensions.find("GL_KHR_blend_equation_advanced ") != std::string::npos; |
533 ext.b_GL_KHR_robustness = | 536 ext.b_GL_KHR_robustness = |
534 extensions.find("GL_KHR_robustness ") != std::string::npos; | 537 extensions.find("GL_KHR_robustness ") != std::string::npos; |
535 ext.b_GL_NV_blend_equation_advanced = | 538 ext.b_GL_NV_blend_equation_advanced = |
536 extensions.find("GL_NV_blend_equation_advanced ") != std::string::npos; | 539 extensions.find("GL_NV_blend_equation_advanced ") != std::string::npos; |
537 ext.b_GL_NV_fence = extensions.find("GL_NV_fence ") != std::string::npos; | 540 ext.b_GL_NV_fence = extensions.find("GL_NV_fence ") != std::string::npos; |
538 ext.b_GL_NV_path_rendering = | 541 ext.b_GL_NV_path_rendering = |
539 extensions.find("GL_NV_path_rendering ") != std::string::npos; | 542 extensions.find("GL_NV_path_rendering ") != std::string::npos; |
540 ext.b_GL_OES_EGL_image = | 543 ext.b_GL_OES_EGL_image = |
541 extensions.find("GL_OES_EGL_image ") != std::string::npos; | 544 extensions.find("GL_OES_EGL_image ") != std::string::npos; |
542 ext.b_GL_OES_get_program_binary = | 545 ext.b_GL_OES_get_program_binary = |
543 extensions.find("GL_OES_get_program_binary ") != std::string::npos; | 546 extensions.find("GL_OES_get_program_binary ") != std::string::npos; |
544 ext.b_GL_OES_mapbuffer = | 547 ext.b_GL_OES_mapbuffer = |
545 extensions.find("GL_OES_mapbuffer ") != std::string::npos; | 548 extensions.find("GL_OES_mapbuffer ") != std::string::npos; |
546 ext.b_GL_OES_vertex_array_object = | 549 ext.b_GL_OES_vertex_array_object = |
547 extensions.find("GL_OES_vertex_array_object ") != std::string::npos; | 550 extensions.find("GL_OES_vertex_array_object ") != std::string::npos; |
548 | 551 |
| 552 debug_fn.glApplyFramebufferAttachmentCMAAINTELFn = 0; |
| 553 if (ext.b_GL_INTEL_framebuffer_CMAA) { |
| 554 fn.glApplyFramebufferAttachmentCMAAINTELFn = |
| 555 reinterpret_cast<glApplyFramebufferAttachmentCMAAINTELProc>( |
| 556 GetGLProcAddress("glApplyFramebufferAttachmentCMAAINTEL")); |
| 557 DCHECK(fn.glApplyFramebufferAttachmentCMAAINTELFn); |
| 558 } |
| 559 |
549 debug_fn.glBeginQueryFn = 0; | 560 debug_fn.glBeginQueryFn = 0; |
550 if (!ver->is_es || ver->IsAtLeastGLES(3u, 0u)) { | 561 if (!ver->is_es || ver->IsAtLeastGLES(3u, 0u)) { |
551 fn.glBeginQueryFn = | 562 fn.glBeginQueryFn = |
552 reinterpret_cast<glBeginQueryProc>(GetGLProcAddress("glBeginQuery")); | 563 reinterpret_cast<glBeginQueryProc>(GetGLProcAddress("glBeginQuery")); |
553 DCHECK(fn.glBeginQueryFn); | 564 DCHECK(fn.glBeginQueryFn); |
554 } else if (ext.b_GL_ARB_occlusion_query) { | 565 } else if (ext.b_GL_ARB_occlusion_query) { |
555 fn.glBeginQueryFn = | 566 fn.glBeginQueryFn = |
556 reinterpret_cast<glBeginQueryProc>(GetGLProcAddress("glBeginQueryARB")); | 567 reinterpret_cast<glBeginQueryProc>(GetGLProcAddress("glBeginQueryARB")); |
557 DCHECK(fn.glBeginQueryFn); | 568 DCHECK(fn.glBeginQueryFn); |
558 } else if (ext.b_GL_EXT_disjoint_timer_query || | 569 } else if (ext.b_GL_EXT_disjoint_timer_query || |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2113 } | 2124 } |
2114 | 2125 |
2115 extern "C" { | 2126 extern "C" { |
2116 | 2127 |
2117 static void GL_BINDING_CALL Debug_glActiveTexture(GLenum texture) { | 2128 static void GL_BINDING_CALL Debug_glActiveTexture(GLenum texture) { |
2118 GL_SERVICE_LOG("glActiveTexture" | 2129 GL_SERVICE_LOG("glActiveTexture" |
2119 << "(" << GLEnums::GetStringEnum(texture) << ")"); | 2130 << "(" << GLEnums::GetStringEnum(texture) << ")"); |
2120 g_driver_gl.debug_fn.glActiveTextureFn(texture); | 2131 g_driver_gl.debug_fn.glActiveTextureFn(texture); |
2121 } | 2132 } |
2122 | 2133 |
| 2134 static void GL_BINDING_CALL Debug_glApplyFramebufferAttachmentCMAAINTEL(void) { |
| 2135 GL_SERVICE_LOG("glApplyFramebufferAttachmentCMAAINTEL" |
| 2136 << "(" |
| 2137 << ")"); |
| 2138 g_driver_gl.debug_fn.glApplyFramebufferAttachmentCMAAINTELFn(); |
| 2139 } |
| 2140 |
2123 static void GL_BINDING_CALL Debug_glAttachShader(GLuint program, | 2141 static void GL_BINDING_CALL Debug_glAttachShader(GLuint program, |
2124 GLuint shader) { | 2142 GLuint shader) { |
2125 GL_SERVICE_LOG("glAttachShader" | 2143 GL_SERVICE_LOG("glAttachShader" |
2126 << "(" << program << ", " << shader << ")"); | 2144 << "(" << program << ", " << shader << ")"); |
2127 g_driver_gl.debug_fn.glAttachShaderFn(program, shader); | 2145 g_driver_gl.debug_fn.glAttachShaderFn(program, shader); |
2128 } | 2146 } |
2129 | 2147 |
2130 static void GL_BINDING_CALL Debug_glBeginQuery(GLenum target, GLuint id) { | 2148 static void GL_BINDING_CALL Debug_glBeginQuery(GLenum target, GLuint id) { |
2131 GL_SERVICE_LOG("glBeginQuery" | 2149 GL_SERVICE_LOG("glBeginQuery" |
2132 << "(" << GLEnums::GetStringEnum(target) << ", " << id << ")"); | 2150 << "(" << GLEnums::GetStringEnum(target) << ", " << id << ")"); |
(...skipping 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5015 GL_SERVICE_LOG("GL_RESULT: " << result); | 5033 GL_SERVICE_LOG("GL_RESULT: " << result); |
5016 return result; | 5034 return result; |
5017 } | 5035 } |
5018 } // extern "C" | 5036 } // extern "C" |
5019 | 5037 |
5020 void DriverGL::InitializeDebugBindings() { | 5038 void DriverGL::InitializeDebugBindings() { |
5021 if (!debug_fn.glActiveTextureFn) { | 5039 if (!debug_fn.glActiveTextureFn) { |
5022 debug_fn.glActiveTextureFn = fn.glActiveTextureFn; | 5040 debug_fn.glActiveTextureFn = fn.glActiveTextureFn; |
5023 fn.glActiveTextureFn = Debug_glActiveTexture; | 5041 fn.glActiveTextureFn = Debug_glActiveTexture; |
5024 } | 5042 } |
| 5043 if (!debug_fn.glApplyFramebufferAttachmentCMAAINTELFn) { |
| 5044 debug_fn.glApplyFramebufferAttachmentCMAAINTELFn = |
| 5045 fn.glApplyFramebufferAttachmentCMAAINTELFn; |
| 5046 fn.glApplyFramebufferAttachmentCMAAINTELFn = |
| 5047 Debug_glApplyFramebufferAttachmentCMAAINTEL; |
| 5048 } |
5025 if (!debug_fn.glAttachShaderFn) { | 5049 if (!debug_fn.glAttachShaderFn) { |
5026 debug_fn.glAttachShaderFn = fn.glAttachShaderFn; | 5050 debug_fn.glAttachShaderFn = fn.glAttachShaderFn; |
5027 fn.glAttachShaderFn = Debug_glAttachShader; | 5051 fn.glAttachShaderFn = Debug_glAttachShader; |
5028 } | 5052 } |
5029 if (!debug_fn.glBeginQueryFn) { | 5053 if (!debug_fn.glBeginQueryFn) { |
5030 debug_fn.glBeginQueryFn = fn.glBeginQueryFn; | 5054 debug_fn.glBeginQueryFn = fn.glBeginQueryFn; |
5031 fn.glBeginQueryFn = Debug_glBeginQuery; | 5055 fn.glBeginQueryFn = Debug_glBeginQuery; |
5032 } | 5056 } |
5033 if (!debug_fn.glBeginTransformFeedbackFn) { | 5057 if (!debug_fn.glBeginTransformFeedbackFn) { |
5034 debug_fn.glBeginTransformFeedbackFn = fn.glBeginTransformFeedbackFn; | 5058 debug_fn.glBeginTransformFeedbackFn = fn.glBeginTransformFeedbackFn; |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6245 } | 6269 } |
6246 | 6270 |
6247 void DriverGL::ClearBindings() { | 6271 void DriverGL::ClearBindings() { |
6248 memset(this, 0, sizeof(*this)); | 6272 memset(this, 0, sizeof(*this)); |
6249 } | 6273 } |
6250 | 6274 |
6251 void GLApiBase::glActiveTextureFn(GLenum texture) { | 6275 void GLApiBase::glActiveTextureFn(GLenum texture) { |
6252 driver_->fn.glActiveTextureFn(texture); | 6276 driver_->fn.glActiveTextureFn(texture); |
6253 } | 6277 } |
6254 | 6278 |
| 6279 void GLApiBase::glApplyFramebufferAttachmentCMAAINTELFn(void) { |
| 6280 driver_->fn.glApplyFramebufferAttachmentCMAAINTELFn(); |
| 6281 } |
| 6282 |
6255 void GLApiBase::glAttachShaderFn(GLuint program, GLuint shader) { | 6283 void GLApiBase::glAttachShaderFn(GLuint program, GLuint shader) { |
6256 driver_->fn.glAttachShaderFn(program, shader); | 6284 driver_->fn.glAttachShaderFn(program, shader); |
6257 } | 6285 } |
6258 | 6286 |
6259 void GLApiBase::glBeginQueryFn(GLenum target, GLuint id) { | 6287 void GLApiBase::glBeginQueryFn(GLenum target, GLuint id) { |
6260 driver_->fn.glBeginQueryFn(target, id); | 6288 driver_->fn.glBeginQueryFn(target, id); |
6261 } | 6289 } |
6262 | 6290 |
6263 void GLApiBase::glBeginTransformFeedbackFn(GLenum primitiveMode) { | 6291 void GLApiBase::glBeginTransformFeedbackFn(GLenum primitiveMode) { |
6264 driver_->fn.glBeginTransformFeedbackFn(primitiveMode); | 6292 driver_->fn.glBeginTransformFeedbackFn(primitiveMode); |
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7982 GLbitfield flags, | 8010 GLbitfield flags, |
7983 GLuint64 timeout) { | 8011 GLuint64 timeout) { |
7984 return driver_->fn.glWaitSyncFn(sync, flags, timeout); | 8012 return driver_->fn.glWaitSyncFn(sync, flags, timeout); |
7985 } | 8013 } |
7986 | 8014 |
7987 void TraceGLApi::glActiveTextureFn(GLenum texture) { | 8015 void TraceGLApi::glActiveTextureFn(GLenum texture) { |
7988 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glActiveTexture") | 8016 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glActiveTexture") |
7989 gl_api_->glActiveTextureFn(texture); | 8017 gl_api_->glActiveTextureFn(texture); |
7990 } | 8018 } |
7991 | 8019 |
| 8020 void TraceGLApi::glApplyFramebufferAttachmentCMAAINTELFn(void) { |
| 8021 TRACE_EVENT_BINARY_EFFICIENT0( |
| 8022 "gpu", "TraceGLAPI::glApplyFramebufferAttachmentCMAAINTEL") |
| 8023 gl_api_->glApplyFramebufferAttachmentCMAAINTELFn(); |
| 8024 } |
| 8025 |
7992 void TraceGLApi::glAttachShaderFn(GLuint program, GLuint shader) { | 8026 void TraceGLApi::glAttachShaderFn(GLuint program, GLuint shader) { |
7993 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glAttachShader") | 8027 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glAttachShader") |
7994 gl_api_->glAttachShaderFn(program, shader); | 8028 gl_api_->glAttachShaderFn(program, shader); |
7995 } | 8029 } |
7996 | 8030 |
7997 void TraceGLApi::glBeginQueryFn(GLenum target, GLuint id) { | 8031 void TraceGLApi::glBeginQueryFn(GLenum target, GLuint id) { |
7998 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glBeginQuery") | 8032 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glBeginQuery") |
7999 gl_api_->glBeginQueryFn(target, id); | 8033 gl_api_->glBeginQueryFn(target, id); |
8000 } | 8034 } |
8001 | 8035 |
(...skipping 2040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10042 GLuint64 timeout) { | 10076 GLuint64 timeout) { |
10043 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glWaitSync") | 10077 TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::glWaitSync") |
10044 return gl_api_->glWaitSyncFn(sync, flags, timeout); | 10078 return gl_api_->glWaitSyncFn(sync, flags, timeout); |
10045 } | 10079 } |
10046 | 10080 |
10047 void NoContextGLApi::glActiveTextureFn(GLenum texture) { | 10081 void NoContextGLApi::glActiveTextureFn(GLenum texture) { |
10048 NOTREACHED() << "Trying to call glActiveTexture() without current GL context"; | 10082 NOTREACHED() << "Trying to call glActiveTexture() without current GL context"; |
10049 LOG(ERROR) << "Trying to call glActiveTexture() without current GL context"; | 10083 LOG(ERROR) << "Trying to call glActiveTexture() without current GL context"; |
10050 } | 10084 } |
10051 | 10085 |
| 10086 void NoContextGLApi::glApplyFramebufferAttachmentCMAAINTELFn(void) { |
| 10087 NOTREACHED() << "Trying to call glApplyFramebufferAttachmentCMAAINTEL() " |
| 10088 "without current GL context"; |
| 10089 LOG(ERROR) << "Trying to call glApplyFramebufferAttachmentCMAAINTEL() " |
| 10090 "without current GL context"; |
| 10091 } |
| 10092 |
10052 void NoContextGLApi::glAttachShaderFn(GLuint program, GLuint shader) { | 10093 void NoContextGLApi::glAttachShaderFn(GLuint program, GLuint shader) { |
10053 NOTREACHED() << "Trying to call glAttachShader() without current GL context"; | 10094 NOTREACHED() << "Trying to call glAttachShader() without current GL context"; |
10054 LOG(ERROR) << "Trying to call glAttachShader() without current GL context"; | 10095 LOG(ERROR) << "Trying to call glAttachShader() without current GL context"; |
10055 } | 10096 } |
10056 | 10097 |
10057 void NoContextGLApi::glBeginQueryFn(GLenum target, GLuint id) { | 10098 void NoContextGLApi::glBeginQueryFn(GLenum target, GLuint id) { |
10058 NOTREACHED() << "Trying to call glBeginQuery() without current GL context"; | 10099 NOTREACHED() << "Trying to call glBeginQuery() without current GL context"; |
10059 LOG(ERROR) << "Trying to call glBeginQuery() without current GL context"; | 10100 LOG(ERROR) << "Trying to call glBeginQuery() without current GL context"; |
10060 } | 10101 } |
10061 | 10102 |
(...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12419 | 12460 |
12420 GLenum NoContextGLApi::glWaitSyncFn(GLsync sync, | 12461 GLenum NoContextGLApi::glWaitSyncFn(GLsync sync, |
12421 GLbitfield flags, | 12462 GLbitfield flags, |
12422 GLuint64 timeout) { | 12463 GLuint64 timeout) { |
12423 NOTREACHED() << "Trying to call glWaitSync() without current GL context"; | 12464 NOTREACHED() << "Trying to call glWaitSync() without current GL context"; |
12424 LOG(ERROR) << "Trying to call glWaitSync() without current GL context"; | 12465 LOG(ERROR) << "Trying to call glWaitSync() without current GL context"; |
12425 return static_cast<GLenum>(0); | 12466 return static_cast<GLenum>(0); |
12426 } | 12467 } |
12427 | 12468 |
12428 } // namespace gfx | 12469 } // namespace gfx |
OLD | NEW |