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

Unified Diff: src/pipe/SkGPipeRead.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/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pipe/SkGPipeRead.cpp
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index 48e0c0641baa2370bd0996c5c521b6d1a41863ae..ef1eeb303b4b4f86bf0266e78254a18ebefaf7a3 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -643,15 +643,14 @@ static void drawBitmapRect_rp(SkCanvas* canvas, SkReader32* reader,
} else {
src = NULL;
}
- SkCanvas::DrawBitmapRectFlags dbmrFlags = SkCanvas::kNone_DrawBitmapRectFlag;
+ SkCanvas::SrcRectConstraint constraint = SkCanvas::kStrict_SrcRectConstraint;
if (flags & kDrawBitmap_Bleed_DrawOpFlag) {
- dbmrFlags = (SkCanvas::DrawBitmapRectFlags)(dbmrFlags|SkCanvas::kBleed_DrawBitmapRectFlag);
+ constraint = SkCanvas::kFast_SrcRectConstraint;
}
const SkRect* dst = skip<SkRect>(reader);
const SkBitmap* bitmap = holder.getBitmap();
if (state->shouldDraw()) {
- canvas->drawBitmapRectToRect(*bitmap, src, *dst,
- hasPaint ? &state->paint() : NULL, dbmrFlags);
+ canvas->drawBitmapRect(*bitmap, src, *dst, hasPaint ? &state->paint() : NULL, constraint);
}
}
@@ -689,9 +688,11 @@ static void drawImageRect_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32
src = skip<SkRect>(reader);
}
const SkRect* dst = skip<SkRect>(reader);
+ SkCanvas::SrcRectConstraint constraint = (SkCanvas::SrcRectConstraint)reader->readInt();
+
const SkImage* image = state->getImage(slot);
if (state->shouldDraw()) {
- canvas->drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NULL);
+ canvas->drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NULL, constraint);
}
}
« no previous file with comments | « src/pipe/SkGPipePriv.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698