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

Unified Diff: gm/imagefilterscropexpand.cpp

Issue 1701133002: Remove 6-param applyCropRect() from lighting filters (raster path). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix another 100-col issue Created 4 years, 10 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/effects/SkLightingImageFilter.cpp » ('j') | src/effects/SkLightingImageFilter.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilterscropexpand.cpp
diff --git a/gm/imagefilterscropexpand.cpp b/gm/imagefilterscropexpand.cpp
index 4fa9b0084e96e7a5a3b7702b647bc1a4f09588bd..5c3dfc598fef21eef04a6a9fb42690d0084648a6 100644
--- a/gm/imagefilterscropexpand.cpp
+++ b/gm/imagefilterscropexpand.cpp
@@ -19,8 +19,10 @@
#include "SkImageSource.h"
#include "SkMorphologyImageFilter.h"
#include "SkColorFilterImageFilter.h"
+#include "SkLightingImageFilter.h"
#include "SkMergeImageFilter.h"
#include "SkOffsetImageFilter.h"
+#include "SkPoint3.h"
#include "SkSurface.h"
///////////////////////////////////////////////////////////////////////////////
@@ -35,7 +37,7 @@ protected:
return SkString("imagefilterscropexpand");
}
- SkISize onISize() override { return SkISize::Make(650, 650); }
+ SkISize onISize() override { return SkISize::Make(730, 650); }
void onDraw(SkCanvas* canvas) override {
SkAutoTUnref<SkColorFilter> cf(
@@ -62,6 +64,9 @@ protected:
SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
SkScalar MARGIN = SkIntToScalar(12);
+ SkPoint3 pointLocation = SkPoint3::Make(0, 0, SkIntToScalar(10));
+ SkScalar kd = SkIntToScalar(2);
+ SkScalar surfaceScale = SkIntToScalar(1);
SkIRect bounds;
r.roundOut(&bounds);
@@ -105,6 +110,10 @@ protected:
Draw(canvas, checkerboard, rect, SkOffsetImageFilter::Create(
SkIntToScalar(-8), SkIntToScalar(16), noopCropped.get(), &big_rect));
+ Draw(canvas, checkerboard, rect,
+ SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, SK_ColorWHITE,
+ surfaceScale, kd, noopCropped.get(), &big_rect));
+
canvas->restore();
canvas->translate(0, SkIntToScalar(80));
}
« no previous file with comments | « no previous file | src/effects/SkLightingImageFilter.cpp » ('j') | src/effects/SkLightingImageFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698