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

Unified Diff: gm/lighting.cpp

Issue 1869763002: Update LightingImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address code review comments Created 4 years, 8 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 | « gm/imagefiltersscaled.cpp ('k') | include/effects/SkLightingImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lighting.cpp
diff --git a/gm/lighting.cpp b/gm/lighting.cpp
index 08d09c2ecb14b88e8eecc1199124bae2198c97d6..7915c331d0d03edf4da18876a35093d97bb113f6 100644
--- a/gm/lighting.cpp
+++ b/gm/lighting.cpp
@@ -93,64 +93,64 @@ protected:
int y = 0;
for (int i = 0; i < 3; i++) {
const SkImageFilter::CropRect* cr = (i == 1) ? &cropRect : (i == 2) ? &fullSizeCropRect : nullptr;
- SkImageFilter* input = (i == 2) ? noopCropped.get() : nullptr;
- paint.setImageFilter(SkLightingImageFilter::CreatePointLitDiffuse(pointLocation,
+ sk_sp<SkImageFilter> input = (i == 2) ? noopCropped : nullptr;
+ paint.setImageFilter(SkLightingImageFilter::MakePointLitDiffuse(pointLocation,
+ white,
+ surfaceScale,
+ kd,
+ input,
+ cr));
+ drawClippedBitmap(canvas, paint, 0, y);
+
+ paint.setImageFilter(SkLightingImageFilter::MakeDistantLitDiffuse(distantDirection,
white,
surfaceScale,
kd,
input,
- cr))->unref();
- drawClippedBitmap(canvas, paint, 0, y);
-
- paint.setImageFilter(SkLightingImageFilter::CreateDistantLitDiffuse(distantDirection,
- white,
- surfaceScale,
- kd,
- input,
- cr))->unref();
+ cr));
drawClippedBitmap(canvas, paint, 110, y);
- paint.setImageFilter(SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation,
- spotTarget,
- spotExponent,
- cutoffAngle,
- white,
- surfaceScale,
- kd,
- input,
- cr))->unref();
+ paint.setImageFilter(SkLightingImageFilter::MakeSpotLitDiffuse(spotLocation,
+ spotTarget,
+ spotExponent,
+ cutoffAngle,
+ white,
+ surfaceScale,
+ kd,
+ input,
+ cr));
drawClippedBitmap(canvas, paint, 220, y);
y += 110;
- paint.setImageFilter(SkLightingImageFilter::CreatePointLitSpecular(pointLocation,
+ paint.setImageFilter(SkLightingImageFilter::MakePointLitSpecular(pointLocation,
+ white,
+ surfaceScale,
+ ks,
+ shininess,
+ input,
+ cr));
+ drawClippedBitmap(canvas, paint, 0, y);
+
+ paint.setImageFilter(SkLightingImageFilter::MakeDistantLitSpecular(distantDirection,
white,
surfaceScale,
ks,
shininess,
input,
- cr))->unref();
- drawClippedBitmap(canvas, paint, 0, y);
-
- paint.setImageFilter(SkLightingImageFilter::CreateDistantLitSpecular(distantDirection,
- white,
- surfaceScale,
- ks,
- shininess,
- input,
- cr))->unref();
+ cr));
drawClippedBitmap(canvas, paint, 110, y);
- paint.setImageFilter(SkLightingImageFilter::CreateSpotLitSpecular(spotLocation,
- spotTarget,
- spotExponent,
- cutoffAngle,
- white,
- surfaceScale,
- ks,
- shininess,
- input,
- cr))->unref();
+ paint.setImageFilter(SkLightingImageFilter::MakeSpotLitSpecular(spotLocation,
+ spotTarget,
+ spotExponent,
+ cutoffAngle,
+ white,
+ surfaceScale,
+ ks,
+ shininess,
+ input,
+ cr));
drawClippedBitmap(canvas, paint, 220, y);
y += 110;
« no previous file with comments | « gm/imagefiltersscaled.cpp ('k') | include/effects/SkLightingImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698