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/MipMapBench.cpp b/bench/MipMapBench.cpp
index 18af1e5..2fb52bb 100644
--- a/bench/MipMapBench.cpp
+++ b/bench/MipMapBench.cpp
@@ -22,7 +22,7 @@
const char* onGetName() override { return "mipmap_build"; }
- void onPreDraw() override {
+ void onDelayedSetup() override {
fBitmap.allocN32Pixels(1000, 1000, true);
fBitmap.eraseColor(SK_ColorWHITE); // so we don't read uninitialized memory
}