зеркало из https://github.com/mozilla/moz-skia.git
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:
Родитель
8db6f23d90
Коммит
12b1831ea4
|
@ -94,12 +94,11 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void test(const int loops, SkCanvas* canvas) {
|
void test(const int loops, SkCanvas* canvas) {
|
||||||
|
SkPaint paint;
|
||||||
|
for (int i = 0; i < loops; i++) {
|
||||||
SkAutoTUnref<SkColorFilter> colorCube(
|
SkAutoTUnref<SkColorFilter> colorCube(
|
||||||
SkColorCubeFilter::Create(fCubeData, fCubeDimension));
|
SkColorCubeFilter::Create(fCubeData, fCubeDimension));
|
||||||
SkPaint paint;
|
|
||||||
paint.setColorFilter(colorCube);
|
paint.setColorFilter(colorCube);
|
||||||
|
|
||||||
for (int i = 0; i < loops; i++) {
|
|
||||||
canvas->drawBitmap(fBitmap, 0, 0, &paint);
|
canvas->drawBitmap(fBitmap, 0, 0, &paint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче