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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: remove iswideopen Created 4 years, 7 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
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 899083dbb468260a3b63d04b6e5354971f84f34c..761c57bb173628f43531f35cb561a4fb5950e25a 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -287,13 +287,13 @@ sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
return nullptr;
}
- SkRect srcRect = SkRect::Make(bounds);
- SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
- GrClip clip(dstRect);
+ const SkIRect& dstIRect = SkIRect::MakeWH(bounds.width(), bounds.height());
bsalomon 2016/05/13 02:34:12 Does the change to references here add any value?
Chris Dalton 2016/05/13 03:53:46 Semantically it avoids a copy constructor. But sin
bsalomon 2016/05/13 13:44:56 Ok, given that the Make functions are short NVRO-c
+ const SkRect& srcRect = SkRect::Make(bounds);
+ const SkRect& dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
+ GrFixedClip clip(dstIRect);
drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
- return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()),
- kNeedNewImageUniqueID_SpecialImage,
+ return SkSpecialImage::MakeFromGpu(dstIRect, kNeedNewImageUniqueID_SpecialImage,
drawContext->asTexture());
}
#endif

Powered by Google App Engine
This is Rietveld 408576698