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

Unified Diff: src/effects/SkColorCubeFilter.cpp

Issue 1821103004: Revert of 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: 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 | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorCubeFilter.cpp
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index d80a02fef2424bb801407aaacdf95c35e75e6687..d59f123a80aaf0bfd2c37f6650571873a0f8f6c2 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -48,19 +48,19 @@
(nullptr != cubeData) && (cubeData->size() >= minMemorySize);
}
-sk_sp<SkColorFilter> SkColorCubeFilter::Make(sk_sp<SkData> cubeData, int cubeDimension) {
- if (!is_valid_3D_lut(cubeData.get(), cubeDimension)) {
+SkColorFilter* SkColorCubeFilter::Create(SkData* cubeData, int cubeDimension) {
+ if (!is_valid_3D_lut(cubeData, cubeDimension)) {
return nullptr;
}
- return sk_sp<SkColorFilter>(new SkColorCubeFilter(std::move(cubeData), cubeDimension));
-}
-
-SkColorCubeFilter::SkColorCubeFilter(sk_sp<SkData> cubeData, int cubeDimension)
- : fCubeData(std::move(cubeData))
- , fUniqueID(SkNextColorCubeUniqueID())
- , fCache(cubeDimension)
-{}
+ return new SkColorCubeFilter(cubeData, cubeDimension);
+}
+
+SkColorCubeFilter::SkColorCubeFilter(SkData* cubeData, int cubeDimension)
+ : fCubeData(SkRef(cubeData))
+ , fUniqueID(SkNextColorCubeUniqueID())
+ , fCache(cubeDimension) {
+}
uint32_t SkColorCubeFilter::getFlags() const {
return this->INHERITED::getFlags() | kAlphaUnchanged_Flag;
@@ -142,7 +142,7 @@
if (!buffer.validate(is_valid_3D_lut(cubeData.get(), cubeDimension))) {
return nullptr;
}
- return Make(std::move(cubeData), cubeDimension).release();
+ return Create(cubeData.get(), cubeDimension);
}
void SkColorCubeFilter::flatten(SkWriteBuffer& buffer) const {
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698