Fix ANGLE in SampleApp
Typo in DLL name meant that we were never running with ANGLE.
Fixing that exposed problem with attachANGLE -> we weren't filling out
attachment info after the first call, resulting in invalid surface
descriptions on windowSizeChanged events.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1892113002
Review URL: https://codereview.chromium.org/1892113002
diff --git a/src/views/win/SkOSWindow_win.cpp b/src/views/win/SkOSWindow_win.cpp
index e948323..c9e7fb5 100644
--- a/src/views/win/SkOSWindow_win.cpp
+++ b/src/views/win/SkOSWindow_win.cpp
@@ -424,7 +424,7 @@
struct ANGLEAssembleContext {
ANGLEAssembleContext() {
fEGL = GetModuleHandle("libEGL.dll");
- fGL = GetModuleHandle("libEGLESv2.dll");
+ fGL = GetModuleHandle("libGLESv2.dll");
}
bool isValid() const { return SkToBool(fEGL) && SkToBool(fGL); }
@@ -567,19 +567,18 @@
GL_CALL(fANGLEInterface, ClearStencil(0));
GL_CALL(fANGLEInterface, ClearColor(0, 0, 0, 0));
GL_CALL(fANGLEInterface, StencilMask(0xffffffff));
- GL_CALL(fANGLEInterface, Clear(GL_STENCIL_BUFFER_BIT |GL_COLOR_BUFFER_BIT));
- if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) {
- this->detachANGLE();
- return false;
- }
- eglGetConfigAttrib(fDisplay, fConfig, EGL_STENCIL_SIZE, &info->fStencilBits);
- eglGetConfigAttrib(fDisplay, fConfig, EGL_SAMPLES, &info->fSampleCount);
-
- GL_CALL(fANGLEInterface, Viewport(0, 0, SkScalarRoundToInt(this->width()),
- SkScalarRoundToInt(this->height())));
- return true;
+ GL_CALL(fANGLEInterface, Clear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT));
}
- return false;
+ if (!eglMakeCurrent(fDisplay, fSurface, fSurface, fContext)) {
+ this->detachANGLE();
+ return false;
+ }
+ eglGetConfigAttrib(fDisplay, fConfig, EGL_STENCIL_SIZE, &info->fStencilBits);
+ eglGetConfigAttrib(fDisplay, fConfig, EGL_SAMPLES, &info->fSampleCount);
+
+ GL_CALL(fANGLEInterface, Viewport(0, 0, SkScalarRoundToInt(this->width()),
+ SkScalarRoundToInt(this->height())));
+ return true;
}
void SkOSWindow::detachANGLE() {