Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Unified Diff: bench/ColorCubeBench.cpp

Issue 1825073002: Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove flag Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/BlurRoundRectBench.cpp ('k') | bench/ColorFilterBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ColorCubeBench.cpp
diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp
index 9f6bd001ff00b5b972dad83acce4d87f65ea7386..6a7774012dab3412e831e234afdaaa732bef8f65 100644
--- a/bench/ColorCubeBench.cpp
+++ b/bench/ColorCubeBench.cpp
@@ -13,20 +13,14 @@
class ColorCubeBench : public Benchmark {
SkISize fSize;
int fCubeDimension;
- SkData* fCubeData;
+ sk_sp<SkData> fCubeData;
SkBitmap fBitmap;
public:
- ColorCubeBench()
- : fCubeDimension(0)
- , fCubeData(nullptr) {
+ ColorCubeBench() : fCubeDimension(0) {
fSize = SkISize::Make(2880, 1800); // 2014 Macbook Pro resolution
}
- ~ColorCubeBench() {
- SkSafeUnref(fCubeData);
- }
-
protected:
const char* onGetName() override {
return "colorcube";
@@ -71,7 +65,7 @@ private:
void makeCubeData() {
fCubeDimension = 32;
- fCubeData = SkData::NewUninitialized(sizeof(SkColor) *
+ fCubeData = SkData::MakeUninitialized(sizeof(SkColor) *
fCubeDimension * fCubeDimension * fCubeDimension);
SkColor* pixels = (SkColor*)(fCubeData->writable_data());
SkAutoTMalloc<uint8_t> lutMemory(fCubeDimension);
@@ -95,9 +89,7 @@ private:
void test(int loops, SkCanvas* canvas) {
SkPaint paint;
for (int i = 0; i < loops; i++) {
- SkAutoTUnref<SkColorFilter> colorCube(
- SkColorCubeFilter::Create(fCubeData, fCubeDimension));
- paint.setColorFilter(colorCube);
+ paint.setColorFilter(SkColorCubeFilter::Make(fCubeData, fCubeDimension));
canvas->drawBitmap(fBitmap, 0, 0, &paint);
}
}
« no previous file with comments | « bench/BlurRoundRectBench.cpp ('k') | bench/ColorFilterBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698