From 8a6697af95b340aad6dee7e6228048fa305c1e59 Mon Sep 17 00:00:00 2001 From: joshualitt Date: Wed, 30 Sep 2015 12:11:07 -0700 Subject: 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 --- bench/MatrixBench.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bench/MatrixBench.cpp') diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp index 75736aa143..9471f18008 100644 --- a/bench/MatrixBench.cpp +++ b/bench/MatrixBench.cpp @@ -146,7 +146,7 @@ public: DecomposeMatrixBench() : INHERITED("decompose") {} protected: - void onPreDraw() override { + void onDelayedSetup() override { for (int i = 0; i < 10; ++i) { SkScalar rot0 = (fRandom.nextBool()) ? fRandom.nextRangeF(-180, 180) : 0.0f; SkScalar sx = fRandom.nextRangeF(-3000.f, 3000.f); -- cgit v1.2.3