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
This commit is contained in:
sugoi 2014-10-09 11:35:09 -07:00 коммит произвёл Commit bot
Родитель 8db6f23d90
Коммит 12b1831ea4
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -94,12 +94,11 @@ private:
}
void test(const int loops, SkCanvas* canvas) {
SkAutoTUnref<SkColorFilter> colorCube(
SkColorCubeFilter::Create(fCubeData, fCubeDimension));
SkPaint paint;
paint.setColorFilter(colorCube);
for (int i = 0; i < loops; i++) {
SkAutoTUnref<SkColorFilter> colorCube(
SkColorCubeFilter::Create(fCubeData, fCubeDimension));
paint.setColorFilter(colorCube);
canvas->drawBitmap(fBitmap, 0, 0, &paint);
}
}