Fix for nexus 5 crashing in GL benches
GLBenches do not expect gl state to change between onPerCanvasPreDraw and *PostDraw, but we do a clear and sometimes we clear as draw. This causes us to bind vertex objects / programs / etc.
This change creates two new virtual methods which are called right before and immediately after timing.
BUG=skia:
Review URL: https://codereview.chromium.org/1379853003
diff --git a/bench/GLBench.cpp b/bench/GLBench.cpp
index a2f7a06..23dd04f 100644
--- a/bench/GLBench.cpp
+++ b/bench/GLBench.cpp
@@ -32,7 +32,7 @@
return this->onGetGLContext(ctx);
}
-void GLBench::onPerCanvasPreDraw(SkCanvas* canvas) {
+void GLBench::onPreDraw(SkCanvas* canvas) {
// This bench exclusively tests GL calls directly
const GrGLContext* ctx = this->getGLContext(canvas);
if (!ctx) {
@@ -41,7 +41,7 @@
this->setup(ctx);
}
-void GLBench::onPerCanvasPostDraw(SkCanvas* canvas) {
+void GLBench::onPostDraw(SkCanvas* canvas) {
// This bench exclusively tests GL calls directly
const GrGLContext* ctx = this->getGLContext(canvas);
if (!ctx) {