Index: bench/ColorCubeBench.cpp |
diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp |
index 6a7774012dab3412e831e234afdaaa732bef8f65..9f6bd001ff00b5b972dad83acce4d87f65ea7386 100644 |
--- a/bench/ColorCubeBench.cpp |
+++ b/bench/ColorCubeBench.cpp |
@@ -13,12 +13,18 @@ |
class ColorCubeBench : public Benchmark { |
SkISize fSize; |
int fCubeDimension; |
- sk_sp<SkData> fCubeData; |
+ SkData* fCubeData; |
SkBitmap fBitmap; |
public: |
- ColorCubeBench() : fCubeDimension(0) { |
+ ColorCubeBench() |
+ : fCubeDimension(0) |
+ , fCubeData(nullptr) { |
fSize = SkISize::Make(2880, 1800); // 2014 Macbook Pro resolution |
+ } |
+ |
+ ~ColorCubeBench() { |
+ SkSafeUnref(fCubeData); |
} |
protected: |
@@ -65,7 +71,7 @@ |
void makeCubeData() { |
fCubeDimension = 32; |
- fCubeData = SkData::MakeUninitialized(sizeof(SkColor) * |
+ fCubeData = SkData::NewUninitialized(sizeof(SkColor) * |
fCubeDimension * fCubeDimension * fCubeDimension); |
SkColor* pixels = (SkColor*)(fCubeData->writable_data()); |
SkAutoTMalloc<uint8_t> lutMemory(fCubeDimension); |
@@ -89,7 +95,9 @@ |
void test(int loops, SkCanvas* canvas) { |
SkPaint paint; |
for (int i = 0; i < loops; i++) { |
- paint.setColorFilter(SkColorCubeFilter::Make(fCubeData, fCubeDimension)); |
+ SkAutoTUnref<SkColorFilter> colorCube( |
+ SkColorCubeFilter::Create(fCubeData, fCubeDimension)); |
+ paint.setColorFilter(colorCube); |
canvas->drawBitmap(fBitmap, 0, 0, &paint); |
} |
} |