Index: src/animator/SkDrawGradient.cpp |
diff --git a/src/animator/SkDrawGradient.cpp b/src/animator/SkDrawGradient.cpp |
index 4aecbc3936d862de09b4a9e52d9343b4f58baa91..2fa4502f6bc9e8e762a061031241cf67cf2eb160 100644 |
--- a/src/animator/SkDrawGradient.cpp |
+++ b/src/animator/SkDrawGradient.cpp |
@@ -126,14 +126,12 @@ void SkDrawLinearGradient::dump(SkAnimateMaker* maker) { |
#endif |
SkShader* SkDrawLinearGradient::getShader() { |
- if (addPrelude() == 0 || points.count() != 4) |
+ if (addPrelude() == 0 || points.count() != 4) { |
return nullptr; |
- SkShader* shader = SkGradientShader::CreateLinear((SkPoint*)points.begin(), |
+ } |
+ return SkGradientShader::MakeLinear((SkPoint*)points.begin(), |
fColors.begin(), offsets.begin(), fColors.count(), (SkShader::TileMode) tileMode, |
- 0, getMatrix()); |
- SkAutoTDelete<SkShader> autoDel(shader); |
- (void)autoDel.detach(); |
- return shader; |
+ 0, getMatrix()).release(); |
} |
@@ -161,12 +159,10 @@ void SkDrawRadialGradient::dump(SkAnimateMaker* maker) { |
#endif |
SkShader* SkDrawRadialGradient::getShader() { |
- if (addPrelude() == 0) |
+ if (addPrelude() == 0) { |
return nullptr; |
- SkShader* shader = SkGradientShader::CreateRadial(center, |
+ } |
+ return SkGradientShader::MakeRadial(center, |
radius, fColors.begin(), offsets.begin(), fColors.count(), (SkShader::TileMode) tileMode, |
- 0, getMatrix()); |
- SkAutoTDelete<SkShader> autoDel(shader); |
- (void)autoDel.detach(); |
- return shader; |
+ 0, getMatrix()).release(); |
} |