Add KHR_blend_equation_advanced
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/1319453003 .
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 9051acc..8f0491c 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -40,6 +40,7 @@
"CHROMIUM_texture_mailbox",
"EXT_debug_marker",
"EXT_texture_storage",
+ "KHR_blend_equation_advanced",
"OES_vertex_array_object",
"occlusion_query_EXT"]
diff --git a/mojo/gles2/gles2_impl.cc b/mojo/gles2/gles2_impl.cc
index 195e791..9c50abc 100644
--- a/mojo/gles2/gles2_impl.cc
+++ b/mojo/gles2/gles2_impl.cc
@@ -63,6 +63,7 @@
#include "mojo/public/platform/native/gles2/call_visitor_chromium_texture_mailbox_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_ext_debug_marker_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_ext_texture_storage_autogen.h"
+#include "mojo/public/platform/native/gles2/call_visitor_khr_blend_equation_advanced_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_occlusion_query_ext_autogen.h"
#include "mojo/public/platform/native/gles2/call_visitor_oes_vertex_array_object_autogen.h"
#undef VISIT_GL_CALL
diff --git a/mojo/gpu/mojo_gles2_impl_autogen.cc b/mojo/gpu/mojo_gles2_impl_autogen.cc
index a1e181b..7842a3a 100644
--- a/mojo/gpu/mojo_gles2_impl_autogen.cc
+++ b/mojo/gpu/mojo_gles2_impl_autogen.cc
@@ -1584,7 +1584,8 @@
NOTREACHED() << "Unimplemented MatrixLoadIdentityCHROMIUM.";
}
void MojoGLES2Impl::BlendBarrierKHR() {
- NOTREACHED() << "Unimplemented BlendBarrierKHR.";
+ MojoGLES2MakeCurrent(context_);
+ glBlendBarrierKHR();
}
} // namespace mojo
diff --git a/mojo/public/platform/native/BUILD.gn b/mojo/public/platform/native/BUILD.gn
index bfe85a7..eee3f0c 100644
--- a/mojo/public/platform/native/BUILD.gn
+++ b/mojo/public/platform/native/BUILD.gn
@@ -78,6 +78,8 @@
"gles2_impl_ext_debug_marker_thunks.h",
"gles2_impl_ext_texture_storage_thunks.cc",
"gles2_impl_ext_texture_storage_thunks.h",
+ "gles2_impl_khr_blend_equation_advanced_thunks.cc",
+ "gles2_impl_khr_blend_equation_advanced_thunks.h",
"gles2_impl_occlusion_query_ext_thunks.cc",
"gles2_impl_occlusion_query_ext_thunks.h",
"gles2_impl_oes_vertex_array_object_thunks.cc",
diff --git a/mojo/public/platform/native/gles2/call_visitor_khr_blend_equation_advanced_autogen.h b/mojo/public/platform/native/gles2/call_visitor_khr_blend_equation_advanced_autogen.h
new file mode 100644
index 0000000..b0ca6e7
--- /dev/null
+++ b/mojo/public/platform/native/gles2/call_visitor_khr_blend_equation_advanced_autogen.h
@@ -0,0 +1,11 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file is auto-generated from
+// gpu/command_buffer/build_gles2_cmd_buffer.py
+// It's formatted by clang-format using chromium coding style:
+// clang-format -i -style=chromium filename
+// DO NOT EDIT!
+
+VISIT_GL_CALL(BlendBarrierKHR, void, (), ())
diff --git a/mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.cc b/mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.cc
new file mode 100644
index 0000000..f8a9b86
--- /dev/null
+++ b/mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.cc
@@ -0,0 +1,40 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file is auto-generated from
+// gpu/command_buffer/build_gles2_cmd_buffer.py
+// It's formatted by clang-format using chromium coding style:
+// clang-format -i -style=chromium filename
+// DO NOT EDIT!
+
+#include "mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.h"
+
+#include <assert.h>
+
+#include "mojo/public/platform/native/thunk_export.h"
+
+extern "C" {
+
+static MojoGLES2ImplKHRBlendEquationAdvancedThunks
+ g_impl_khr_blend_equation_advanced_thunks = {0};
+
+#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
+ ReturnType GL_APIENTRY gl##Function PARAMETERS { \
+ assert(g_impl_khr_blend_equation_advanced_thunks.Function); \
+ return g_impl_khr_blend_equation_advanced_thunks.Function ARGUMENTS; \
+ }
+#include "mojo/public/platform/native/gles2/call_visitor_khr_blend_equation_advanced_autogen.h"
+#undef VISIT_GL_CALL
+
+extern "C" THUNK_EXPORT size_t MojoSetGLES2ImplKHRBlendEquationAdvancedThunks(
+ const MojoGLES2ImplKHRBlendEquationAdvancedThunks*
+ gles2_impl_khr_blend_equation_advanced_thunks) {
+ if (gles2_impl_khr_blend_equation_advanced_thunks->size >=
+ sizeof(g_impl_khr_blend_equation_advanced_thunks))
+ g_impl_khr_blend_equation_advanced_thunks =
+ *gles2_impl_khr_blend_equation_advanced_thunks;
+ return sizeof(g_impl_khr_blend_equation_advanced_thunks);
+}
+
+} // extern "C"
diff --git a/mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.h b/mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.h
new file mode 100644
index 0000000..2d82d31
--- /dev/null
+++ b/mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.h
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file is auto-generated from
+// gpu/command_buffer/build_gles2_cmd_buffer.py
+// It's formatted by clang-format using chromium coding style:
+// clang-format -i -style=chromium filename
+// DO NOT EDIT!
+
+#ifndef MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_IMPL_KHR_BLEND_EQUATION_ADVANCED_THUNKS_H_
+#define MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_IMPL_KHR_BLEND_EQUATION_ADVANCED_THUNKS_H_
+
+#include <stddef.h>
+
+#define GL_GLEXT_PROTOTYPES
+#include "mojo/public/c/gpu/GLES2/gl2extmojo.h"
+
+// Specifies the frozen API for the KHR_blend_equation_advanced extension.
+#pragma pack(push, 8)
+struct MojoGLES2ImplKHRBlendEquationAdvancedThunks {
+ size_t size; // Should be set to sizeof(*this).
+
+#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
+ ReturnType(GL_APIENTRY* Function) PARAMETERS;
+#include "mojo/public/platform/native/gles2/call_visitor_khr_blend_equation_advanced_autogen.h"
+#undef VISIT_GL_CALL
+};
+#pragma pack(pop)
+
+#ifdef __cplusplus
+// Intended to be called from the embedder to get the embedder's implementation
+// of khr_blend_equation_advanced.
+inline MojoGLES2ImplKHRBlendEquationAdvancedThunks
+MojoMakeGLES2ImplKHRBlendEquationAdvancedThunks() {
+ MojoGLES2ImplKHRBlendEquationAdvancedThunks
+ gles2_impl_khr_blend_equation_advanced_thunks = {
+ sizeof(MojoGLES2ImplKHRBlendEquationAdvancedThunks),
+#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) gl##Function,
+#include "mojo/public/platform/native/gles2/call_visitor_khr_blend_equation_advanced_autogen.h"
+#undef VISIT_GL_CALL
+ };
+
+ return gles2_impl_khr_blend_equation_advanced_thunks;
+}
+#endif // __cplusplus
+
+// Use this type for the function found by dynamically discovering it in
+// a DSO linked with mojo_system.
+// The contents of |gles2_impl_khr_blend_equation_advanced_thunks| are copied.
+typedef size_t (*MojoSetGLES2ImplKHRBlendEquationAdvancedThunksFn)(
+ const MojoGLES2ImplKHRBlendEquationAdvancedThunks* thunks);
+
+#endif // MOJO_PUBLIC_PLATFORM_NATIVE_GLES2_IMPL_KHR_BLEND_EQUATION_ADVANCED_THUNKS_H_
diff --git a/shell/native_application_support.cc b/shell/native_application_support.cc
index 3b68ad0..35b280e 100644
--- a/shell/native_application_support.cc
+++ b/shell/native_application_support.cc
@@ -15,6 +15,7 @@
#include "mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.h"
#include "mojo/public/platform/native/gles2_impl_ext_debug_marker_thunks.h"
#include "mojo/public/platform/native/gles2_impl_ext_texture_storage_thunks.h"
+#include "mojo/public/platform/native/gles2_impl_khr_blend_equation_advanced_thunks.h"
#include "mojo/public/platform/native/gles2_impl_occlusion_query_ext_thunks.h"
#include "mojo/public/platform/native/gles2_impl_oes_vertex_array_object_thunks.h"
#include "mojo/public/platform/native/gles2_impl_thunks.h"
@@ -85,6 +86,8 @@
"MojoSetGLES2ImplEXTDebugMarkerThunks", app_library);
SetThunks(MojoMakeGLES2ImplEXTTextureStorageThunks,
"MojoSetGLES2ImplEXTTextureStorageThunks", app_library);
+ SetThunks(MojoMakeGLES2ImplKHRBlendEquationAdvancedThunks,
+ "MojoSetGLES2ImplKHRBlendEquationAdvancedThunks", app_library);
SetThunks(MojoMakeGLES2ImplOcclusionQueryEXTThunks,
"MojoSetGLES2ImplOcclusionQueryEXTThunks", app_library);
SetThunks(MojoMakeGLES2ImplOESVertexArrayObjectThunks,