Commit c8434652 authored by Brian Salomon's avatar Brian Salomon Committed by Commit Bot

Use newer GrGLFunction based on templated function types rather than pointers.

Allows https://skia-review.googlesource.com/c/skia/+/154501 to land.

Bug: skia:8262
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ic1a9a6753814a5e6dbdfd057f6a96dbcb152e3b6
Reviewed-on: https://chromium-review.googlesource.com/1224660Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Cr-Commit-Position: refs/heads/master@{#594810}
parent 611030c8
...@@ -26,9 +26,10 @@ class ScopedCallingGLFromSkia { ...@@ -26,9 +26,10 @@ class ScopedCallingGLFromSkia {
}; };
template <typename R, typename... Args> template <typename R, typename... Args>
GrGLFunction<R (*)(Args...)> gles_bind(R (GLES2Interface::*func)(Args...), GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> gles_bind(
GLES2Interface* gles2_interface, R (GLES2Interface::*func)(Args...),
ContextSupport* context_support) { GLES2Interface* gles2_interface,
ContextSupport* context_support) {
if (context_support->HasGrContextSupport()) { if (context_support->HasGrContextSupport()) {
return [func, context_support, gles2_interface](Args... args) { return [func, context_support, gles2_interface](Args... args) {
ScopedCallingGLFromSkia guard(context_support); ScopedCallingGLFromSkia guard(context_support);
......
...@@ -12,8 +12,8 @@ namespace init { ...@@ -12,8 +12,8 @@ namespace init {
namespace { namespace {
template <typename R, typename... Args> template <typename R, typename... Args>
GrGLFunction<R (*)(Args...)> bind(R (gl::GLApi::*func)(Args...), GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> bind(R (gl::GLApi::*func)(Args...),
gl::GLApi* api) { gl::GLApi* api) {
return [func, api](Args... args) { return (api->*func)(args...); }; return [func, api](Args... args) { return (api->*func)(args...); };
} }
...@@ -63,7 +63,7 @@ sk_sp<GrGLInterface> CreateGrGLInterface( ...@@ -63,7 +63,7 @@ sk_sp<GrGLInterface> CreateGrGLInterface(
// by the bindings (GL 4.1 or ES 3.0), and blacklist extensions that skia // by the bindings (GL 4.1 or ES 3.0), and blacklist extensions that skia
// handles but bindings don't. // handles but bindings don't.
// TODO(piman): add bindings for missing entrypoints. // TODO(piman): add bindings for missing entrypoints.
GrGLFunction<GrGLGetStringProc> get_string; GrGLFunction<GrGLGetStringFn> get_string;
const bool apply_version_override = use_version_es2 || const bool apply_version_override = use_version_es2 ||
version_info.IsAtLeastGL(4, 2) || version_info.IsAtLeastGL(4, 2) ||
version_info.IsAtLeastGLES(3, 1); version_info.IsAtLeastGLES(3, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment