Remove legacy GrGLFunction specialization

Requires https://chromium-review.googlesource.com/c/chromium/src/+/1224660
to land.
Bug: skia:8262
Change-Id: I278360315d408e54e04d2e8e331e0be0b76a0d77
Reviewed-on: https://skia-review.googlesource.com/154501
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Salomon 2018-09-13 15:09:02 -04:00 committed by Skia Commit-Bot
parent d3a357db87
commit 23952e2694

View File

@ -261,9 +261,6 @@ using GrEGLCreateImageFn = GrEGLImage GR_GL_FUNCTION_TYPE(GrEGLDisplay dpy, GrEG
using GrEGLDestroyImageFn = GrEGLBoolean GR_GL_FUNCTION_TYPE(GrEGLDisplay dpy, GrEGLImage image);
} // extern "C"
// Legacy name used in Chrome. TODO: Remove when removed from Chrome.
using GrGLGetStringProc = GrGLGetStringFn;
// This is a lighter-weight std::function, trying to reduce code size and compile time
// by only supporting the exact use cases we require.
template <typename T> class GrGLFunction;
@ -303,9 +300,6 @@ public:
};
}
// See other (temporary) specialization below.
GrGLFunction(const GrGLFunction<R(*)(Args...)>& that);
R operator()(Args... args) const {
SkASSERT(fCall);
return fCall(fBuf, std::forward<Args>(args)...);
@ -321,22 +315,4 @@ private:
size_t fBuf[4];
};
/**
* Chrome instantiates GrGLFunctions on function pointers that don't include GR_GL_FUNCTION_TYPE.
* This can go away after Chrome is updated to use the above specialization.
*/
template <typename R, typename... Args>
class GrGLFunction<R (*)(Args...)> : public GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> {
public:
template <typename Closure>
GrGLFunction(Closure closure)
: GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)>(std::move(closure)) {}
};
template <typename R, typename... Args>
GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)>::GrGLFunction(const GrGLFunction<R (*)(Args...)>& that)
: fCall(that.fCall) {
memcpy(fBuf, that.fBuf, sizeof(fBuf));
}
#endif