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

Unified Diff: gm/lighting.cpp

Issue 1057693002: Revert of Implement approx-match support in image filter saveLayer() offscreen. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | src/core/SkCanvas.cpp » ('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 0bfbb47a95e140a4f436a102d43629b171e3555b..36c8ba0e45e17ea1cf989c4824f7834ee0f145b9 100644
--- a/gm/lighting.cpp
+++ b/gm/lighting.cpp
@@ -7,10 +7,9 @@
#include "gm.h"
#include "SkLightingImageFilter.h"
-#include "SkOffsetImageFilter.h"
#define WIDTH 330
-#define HEIGHT 660
+#define HEIGHT 440
namespace skiagm {
@@ -87,70 +86,28 @@
SkPaint paint;
SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(20, 10, 60, 65));
- SkImageFilter::CropRect fullSizeCropRect(SkRect::MakeXYWH(0, 0, 100, 100));
- SkAutoTUnref<SkImageFilter> noopCropped(SkOffsetImageFilter::Create(0, 0, NULL, &cropRect));
int y = 0;
- for (int i = 0; i < 3; i++) {
- const SkImageFilter::CropRect* cr = (i == 1) ? &cropRect : (i == 2) ? &fullSizeCropRect : NULL;
- SkImageFilter* input = (i == 2) ? noopCropped.get() : NULL;
- paint.setImageFilter(SkLightingImageFilter::CreatePointLitDiffuse(pointLocation,
- white,
- surfaceScale,
- kd,
- input,
- cr))->unref();
+ for (int i = 0; i < 2; i++) {
+ const SkImageFilter::CropRect* cr = (i == 0) ? NULL : &cropRect;
+ paint.setImageFilter(SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, surfaceScale, kd, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 0, y);
- paint.setImageFilter(SkLightingImageFilter::CreateDistantLitDiffuse(distantDirection,
- white,
- surfaceScale,
- kd,
- input,
- cr))->unref();
+ paint.setImageFilter(SkLightingImageFilter::CreateDistantLitDiffuse(distantDirection, white, surfaceScale, kd, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 110, y);
- paint.setImageFilter(SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation,
- spotTarget,
- spotExponent,
- cutoffAngle,
- white,
- surfaceScale,
- kd,
- input,
- cr))->unref();
+ paint.setImageFilter(SkLightingImageFilter::CreateSpotLitDiffuse(spotLocation, spotTarget, spotExponent, cutoffAngle, white, surfaceScale, kd, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 220, y);
y += 110;
- paint.setImageFilter(SkLightingImageFilter::CreatePointLitSpecular(pointLocation,
- white,
- surfaceScale,
- ks,
- shininess,
- input,
- cr))->unref();
+ paint.setImageFilter(SkLightingImageFilter::CreatePointLitSpecular(pointLocation, white, surfaceScale, ks, shininess, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 0, y);
- paint.setImageFilter(SkLightingImageFilter::CreateDistantLitSpecular(distantDirection,
- white,
- surfaceScale,
- ks,
- shininess,
- input,
- cr))->unref();
+ paint.setImageFilter(SkLightingImageFilter::CreateDistantLitSpecular(distantDirection, white, surfaceScale, ks, shininess, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 110, y);
- paint.setImageFilter(SkLightingImageFilter::CreateSpotLitSpecular(spotLocation,
- spotTarget,
- spotExponent,
- cutoffAngle,
- white,
- surfaceScale,
- ks,
- shininess,
- input,
- cr))->unref();
+ paint.setImageFilter(SkLightingImageFilter::CreateSpotLitSpecular(spotLocation, spotTarget, spotExponent, cutoffAngle, white, surfaceScale, ks, shininess, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 220, y);
y += 110;
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698