Commit a5c54e0e authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Mac OOP-R crashes: glFlush at every glBindFramebuffer in Skia

Bug: 906453
Change-Id: Ice07136126ce35d128054276e86ac641aba2c882
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1507235Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638636}
parent 159fbcca
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ui/gl/init/create_gr_gl_interface.h"
#include "build/build_config.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/progress_reporter.h"
......@@ -40,6 +41,20 @@ GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> bind_slow(
};
}
template <typename R, typename... Args>
GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> bind_with_flush_on_mac(
R(GL_BINDING_CALL* func)(Args...)) {
#if defined(OS_MACOSX)
return [func](Args... args) {
glFlush();
func(args...);
glFlush();
};
#else
return func;
#endif
}
const GLubyte* GetStringHook(const char* version_string, GLenum name) {
switch (name) {
case GL_VERSION:
......@@ -300,7 +315,8 @@ sk_sp<GrGLInterface> CreateGrGLInterface(
gl->glGetFramebufferAttachmentParameterivEXTFn;
functions->fGetRenderbufferParameteriv =
gl->glGetRenderbufferParameterivEXTFn;
functions->fBindFramebuffer = gl->glBindFramebufferEXTFn;
functions->fBindFramebuffer =
bind_with_flush_on_mac(gl->glBindFramebufferEXTFn);
functions->fFramebufferTexture2D = gl->glFramebufferTexture2DEXTFn;
functions->fCheckFramebufferStatus = gl->glCheckFramebufferStatusEXTFn;
functions->fDeleteFramebuffers =
......
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