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/SortBench.cpp b/bench/SortBench.cpp
index 9d22a45..f621670 100644
--- a/bench/SortBench.cpp
+++ b/bench/SortBench.cpp
@@ -119,7 +119,7 @@
}
// Delayed initialization only done if onDraw will be called.
- void onPreDraw() override {
+ void onDelayedSetup() override {
fUnsorted.reset(N);
gRec[fType].fProc(fUnsorted.get());
}