aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLightingShader.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-25 09:08:00 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-25 09:08:00 -0700
commitfe63045f075165b1be5d3e7fc5c710021d85f53b (patch)
treec60f764504ba1d622613a432c88e43f7f65c0fec /src/core/SkLightingShader.cpp
parentcce49271124ff75c880dc0dfed1489f02c82890b (diff)
move setshader to sk_sp, re-using SK_SUPPORT_LEGACY_CREATESHADER_PTR
Diffstat (limited to 'src/core/SkLightingShader.cpp')
-rw-r--r--src/core/SkLightingShader.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index 02f75f3516..d8e88c9a0a 100644
--- a/src/core/SkLightingShader.cpp
+++ b/src/core/SkLightingShader.cpp
@@ -700,10 +700,10 @@ static bool bitmap_is_too_big(const SkBitmap& bm) {
return bm.width() > kMaxSize || bm.height() > kMaxSize;
}
-SkShader* SkLightingShader::Create(const SkBitmap& diffuse, const SkBitmap& normal,
- const Lights* lights,
- const SkVector& invNormRotation,
- const SkMatrix* diffLocalM, const SkMatrix* normLocalM) {
+sk_sp<SkShader> SkLightingShader::Make(const SkBitmap& diffuse, const SkBitmap& normal,
+ const Lights* lights,
+ const SkVector& invNormRotation,
+ const SkMatrix* diffLocalM, const SkMatrix* normLocalM) {
if (diffuse.isNull() || bitmap_is_too_big(diffuse) ||
normal.isNull() || bitmap_is_too_big(normal) ||
diffuse.width() != normal.width() ||
@@ -713,8 +713,8 @@ SkShader* SkLightingShader::Create(const SkBitmap& diffuse, const SkBitmap& norm
SkASSERT(SkScalarNearlyEqual(invNormRotation.lengthSqd(), SK_Scalar1));
- return new SkLightingShaderImpl(diffuse, normal, lights, invNormRotation, diffLocalM,
- normLocalM);
+ return sk_make_sp<SkLightingShaderImpl>(diffuse, normal, lights, invNormRotation, diffLocalM,
+ normLocalM);
}
///////////////////////////////////////////////////////////////////////////////