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

Unified Diff: src/core/SkDevice.cpp

Issue 1228083004: add src-rect-constraint to drawImageRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 5 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 | « src/core/SkCanvas.cpp ('k') | src/core/SkMiniRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDevice.cpp
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 90161b4eb386d3db240b1cc67e19f7fc572ba5b8..6922e0d7ce04e3e9d724728d81b02c0e4f207dce 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -154,11 +154,12 @@ void SkBaseDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar
}
void SkBaseDevice::drawImageRect(const SkDraw& draw, const SkImage* image, const SkRect* src,
- const SkRect& dst, const SkPaint& paint) {
+ const SkRect& dst, const SkPaint& paint,
+ SkCanvas::SrcRectConstraint constraint) {
// Default impl : turns everything into raster bitmap
SkBitmap bm;
if (as_IB(image)->getROPixels(&bm)) {
- this->drawBitmapRect(draw, bm, src, dst, paint, SkCanvas::kNone_DrawBitmapRectFlag);
+ this->drawBitmapRect(draw, bm, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE)constraint);
}
}
@@ -168,7 +169,7 @@ void SkBaseDevice::drawImageNine(const SkDraw& draw, const SkImage* image, const
SkRect srcR, dstR;
while (iter.next(&srcR, &dstR)) {
- this->drawImageRect(draw, image, &srcR, dstR, paint);
+ this->drawImageRect(draw, image, &srcR, dstR, paint, SkCanvas::kStrict_SrcRectConstraint);
}
}
@@ -178,7 +179,8 @@ void SkBaseDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, co
SkRect srcR, dstR;
while (iter.next(&srcR, &dstR)) {
- this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kNone_DrawBitmapRectFlag);
+ this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint,
+ (SK_VIRTUAL_CONSTRAINT_TYPE)SkCanvas::kStrict_SrcRectConstraint);
}
}
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkMiniRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698