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

Unified Diff: src/core/SkLightingShader.cpp

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 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/core/SkLightingShader.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkLightingShader.cpp
diff --git a/src/core/SkLightingShader.cpp b/src/core/SkLightingShader.cpp
index 02f75f351656e49fb20bada69a98a7acbc49ad76..d8e88c9a0ab03643e1a70c34a4890fae61dbda50 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);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/core/SkLightingShader.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698