From 12b1831ea49f3d88e93b7d2793d94852d03813e8 Mon Sep 17 00:00:00 2001 From: sugoi Date: Thu, 9 Oct 2014 11:35:09 -0700 Subject: [PATCH] Attempt at fixing color cube bench The original bench was hitting the cache since it was using the same color filter for all loops. By creating a new color filter within the loop, at least this part of it is solved. I'm not 100% sure this is the right way, but at least the numbers are a bit more reasonable and are affected by the output resolution. BUG=skia: Review URL: https://codereview.chromium.org/648483002 --- bench/ColorCubeBench.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp index 16ed4ce89..141edf62a 100644 --- a/bench/ColorCubeBench.cpp +++ b/bench/ColorCubeBench.cpp @@ -94,12 +94,11 @@ private: } void test(const int loops, SkCanvas* canvas) { - SkAutoTUnref colorCube( - SkColorCubeFilter::Create(fCubeData, fCubeDimension)); SkPaint paint; - paint.setColorFilter(colorCube); - for (int i = 0; i < loops; i++) { + SkAutoTUnref colorCube( + SkColorCubeFilter::Create(fCubeData, fCubeDimension)); + paint.setColorFilter(colorCube); canvas->drawBitmap(fBitmap, 0, 0, &paint); } }