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

Unified Diff: gm/lighting.cpp

Issue 26371002: Change SkImageFilter's cropRect from SkIRect to a CropRect struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Alternate version, using a single fFlags member. Created 7 years, 2 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/imagefilterscropped.cpp ('k') | gm/morphology.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 891d63a5e4483ded157d3d935c639c76ee050f68..50dceb44e109a85e173098b8efbf25fa6975740a 100644
--- a/gm/lighting.cpp
+++ b/gm/lighting.cpp
@@ -85,11 +85,15 @@ protected:
SkColor white(0xFFFFFFFF);
SkPaint paint;
+#ifdef SK_CROP_RECT_IS_INT
SkIRect cropRect = SkIRect::MakeXYWH(20, 10, 60, 65);
+#else
+ SkImageFilter::CropRect cropRect(SkRect::MakeXYWH(20, 10, 60, 65));
+#endif
int y = 0;
for (int i = 0; i < 2; i++) {
- const SkIRect* cr = (i == 0) ? NULL : &cropRect;
+ const SkImageFilter::CropRect* cr = (i == 0) ? NULL : &cropRect;
paint.setImageFilter(SkLightingImageFilter::CreatePointLitDiffuse(pointLocation, white, surfaceScale, kd, NULL, cr))->unref();
drawClippedBitmap(canvas, paint, 0, y);
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/morphology.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698