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

Unified Diff: src/utils/SkDeferredCanvas.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/svg/SkSVGDevice.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 8e3423584857b0217f8da6759bec4435af4949d3..343d0c45d7c6fcf102396983c512580ecb5e77f3 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -219,7 +219,7 @@ protected:
{SkASSERT(0);}
void drawBitmapRect(const SkDraw&, const SkBitmap&, const SkRect*,
const SkRect&, const SkPaint&,
- SkCanvas::DrawBitmapRectFlags) override
+ SK_VIRTUAL_CONSTRAINT_TYPE) override
{SkASSERT(0);}
void drawSprite(const SkDraw&, const SkBitmap& bitmap,
int x, int y, const SkPaint& paint) override
@@ -227,7 +227,7 @@ protected:
void drawImage(const SkDraw&, const SkImage*, SkScalar, SkScalar, const SkPaint&) override
{SkASSERT(0);}
void drawImageRect(const SkDraw&, const SkImage*, const SkRect*, const SkRect&,
- const SkPaint&) override
+ const SkPaint&, SkCanvas::SrcRectConstraint) override
{SkASSERT(0);}
void drawImageNine(const SkDraw&, const SkImage*, const SkIRect&, const SkRect&,
const SkPaint&) override
@@ -865,8 +865,8 @@ void SkDeferredCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left,
}
void SkDeferredCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
- const SkRect& dst,
- const SkPaint* paint, DrawBitmapRectFlags flags) {
+ const SkRect& dst, const SkPaint* paint,
+ SK_VIRTUAL_CONSTRAINT_TYPE constraint) {
if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
isPaintOpaque(paint, &bitmap)) {
@@ -874,7 +874,7 @@ void SkDeferredCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* sr
}
AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
- this->drawingCanvas()->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
+ this->drawingCanvas()->drawBitmapRect(bitmap, src, dst, paint, (SrcRectConstraint)constraint);
this->recordedDrawCommand();
}
@@ -894,7 +894,7 @@ void SkDeferredCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y,
this->recordedDrawCommand();
}
void SkDeferredCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst,
- const SkPaint* paint) {
+ const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) {
if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
isPaintOpaque(paint, image)) {
@@ -902,7 +902,8 @@ void SkDeferredCanvas::onDrawImageRect(const SkImage* image, const SkRect* src,
}
AutoImmediateDrawIfNeeded autoDraw(*this, image, paint);
- this->drawingCanvas()->drawImageRect(image, src, dst, paint);
+ this->drawingCanvas()->drawImageRect(image, src, dst, paint
+ SRC_RECT_CONSTRAINT_ARG(constraint));
this->recordedDrawCommand();
}
« no previous file with comments | « src/svg/SkSVGDevice.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698