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/ColorPrivBench.cpp b/bench/ColorPrivBench.cpp
index 9c8acce..4aa51c4 100644
--- a/bench/ColorPrivBench.cpp
+++ b/bench/ColorPrivBench.cpp
@@ -24,7 +24,7 @@
const char* onGetName() override { return fName.c_str(); }
- void onPreDraw() override {
+ void onDelayedSetup() override {
// A handful of random srcs and dsts.
SkRandom rand;
for (int i = 0; i < kInputs; i++) {