diff options
author | reed <reed@google.com> | 2015-07-28 07:35:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-28 07:35:14 -0700 |
commit | 562fe4767cc73e08a4e039362bc0336aea66ecfb (patch) | |
tree | 02244ec3279fa16de377f53a7dddce993971048a /src | |
parent | 91f283bb4e6ea71bbd4e6efc27befc29118ee543 (diff) |
remove all guards for changes to drawBitmapRect / drawImageRect
BUG=skia:
Review URL: https://codereview.chromium.org/1239193002
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBitmapDevice.cpp | 2 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 24 | ||||
-rw-r--r-- | src/core/SkDevice.cpp | 5 | ||||
-rw-r--r-- | src/core/SkPictureRecord.cpp | 6 | ||||
-rw-r--r-- | src/core/SkPictureRecord.h | 4 | ||||
-rw-r--r-- | src/core/SkRecorder.cpp | 12 | ||||
-rw-r--r-- | src/core/SkRecorder.h | 4 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 7 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.h | 3 | ||||
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 3 | ||||
-rw-r--r-- | src/pdf/SkPDFDevice.h | 6 | ||||
-rw-r--r-- | src/pipe/SkGPipeWrite.cpp | 13 | ||||
-rw-r--r-- | src/svg/SkSVGDevice.cpp | 2 | ||||
-rw-r--r-- | src/svg/SkSVGDevice.h | 3 | ||||
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 10 | ||||
-rw-r--r-- | src/utils/SkDumpCanvas.cpp | 4 | ||||
-rw-r--r-- | src/utils/SkLuaCanvas.cpp | 4 | ||||
-rw-r--r-- | src/utils/SkNWayCanvas.cpp | 6 | ||||
-rw-r--r-- | src/utils/SkPaintFilterCanvas.cpp | 10 | ||||
-rw-r--r-- | src/utils/debugger/SkDebugCanvas.cpp | 5 | ||||
-rw-r--r-- | src/utils/debugger/SkDebugCanvas.h | 4 |
21 files changed, 49 insertions, 88 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp index 388708d475..9da43d8c9c 100644 --- a/src/core/SkBitmapDevice.cpp +++ b/src/core/SkBitmapDevice.cpp @@ -237,7 +237,7 @@ void SkBitmapDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, void SkBitmapDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint& paint, SK_VIRTUAL_CONSTRAINT_TYPE) { + const SkPaint& paint, SkCanvas::SrcRectConstraint constraint) { SkMatrix matrix; SkRect bitmapBounds, tmpSrc, tmpDst; SkBitmap tmpBitmap; diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index f55ca5e127..2308151b40 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1850,7 +1850,7 @@ void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRe if (dst.isEmpty()) { return; } - this->onDrawImageRect(image, src, dst, paint SRC_RECT_CONSTRAINT_ARG(constraint)); + this->onDrawImageRect(image, src, dst, paint, constraint); } void SkCanvas::drawImageRect(const SkImage* image, const SkIRect& isrc, const SkRect& dst, @@ -1877,22 +1877,12 @@ void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, cons this->onDrawBitmap(bitmap, dx, dy, paint); } -#ifdef SK_SUPPORT_LEGACY_DRAWBITMAPRECTFLAGS_TYPE -void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, DrawBitmapRectFlags flags) { - if (bitmap.drawsNothing() || dst.isEmpty()) { - return; - } - this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE)flags); -} -#endif - void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint) { if (bitmap.drawsNothing() || dst.isEmpty()) { return; } - this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE)constraint); + this->onDrawBitmapRect(bitmap, src, dst, paint, constraint); } void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst, @@ -2145,9 +2135,8 @@ void SkCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const S } void SkCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { + const SkPaint* paint, SrcRectConstraint constraint) { TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawImageRect()"); - SRC_RECT_CONSTRAINT_LOCAL_DEFAULT(constraint) SkRect storage; const SkRect* bounds = &dst; if (NULL == paint || paint->canComputeFastBounds()) { @@ -2224,18 +2213,17 @@ void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, bitmap.isOpaque()) while (iter.next()) { - iter.fDevice->drawBitmapRect(iter, bitmap, src, dst, looper.paint(), - (SK_VIRTUAL_CONSTRAINT_TYPE)constraint); + iter.fDevice->drawBitmapRect(iter, bitmap, src, dst, looper.paint(), constraint); } LOOPER_END } void SkCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, SK_VIRTUAL_CONSTRAINT_TYPE constraint) { + const SkPaint* paint, SrcRectConstraint constraint) { TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawBitmapRectToRect()"); SkDEBUGCODE(bitmap.validate();) - this->internalDrawBitmapRect(bitmap, src, dst, paint, (SrcRectConstraint)constraint); + this->internalDrawBitmapRect(bitmap, src, dst, paint, constraint); } void SkCanvas::onDrawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 6922e0d7ce..dd55aad0ce 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -159,7 +159,7 @@ void SkBaseDevice::drawImageRect(const SkDraw& draw, const SkImage* image, const // Default impl : turns everything into raster bitmap SkBitmap bm; if (as_IB(image)->getROPixels(&bm)) { - this->drawBitmapRect(draw, bm, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE)constraint); + this->drawBitmapRect(draw, bm, src, dst, paint, constraint); } } @@ -179,8 +179,7 @@ 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, - (SK_VIRTUAL_CONSTRAINT_TYPE)SkCanvas::kStrict_SrcRectConstraint); + this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, SkCanvas::kStrict_SrcRectConstraint); } } diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index 60996dbba4..0383dda3d5 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -552,8 +552,7 @@ void SkPictureRecord::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, SkScal } void SkPictureRecord::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, - SK_VIRTUAL_CONSTRAINT_TYPE constraint) { + const SkPaint* paint, SrcRectConstraint constraint) { // id + paint index + bitmap index + bool for 'src' + flags size_t size = 5 * kUInt32Size; if (src) { @@ -585,8 +584,7 @@ void SkPictureRecord::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, } void SkPictureRecord::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { - SRC_RECT_CONSTRAINT_LOCAL_DEFAULT(constraint) + const SkPaint* paint, SrcRectConstraint constraint) { // id + paint_index + image_index + bool_for_src + constraint size_t size = 5 * kUInt32Size; if (src) { diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h index cb6f32418c..18458c6f36 100644 --- a/src/core/SkPictureRecord.h +++ b/src/core/SkPictureRecord.h @@ -182,10 +182,10 @@ protected: void onDrawPath(const SkPath&, const SkPaint&) override; void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, - SK_VIRTUAL_CONSTRAINT_TYPE) override; + SrcRectConstraint) override; void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, - const SkPaint* SRC_RECT_CONSTRAINT_PARAM(constraint)) override; + const SkPaint*, SrcRectConstraint) override; void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst, const SkPaint*) override; void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp index 41164bd8a2..c00a353cec 100644 --- a/src/core/SkRecorder.cpp +++ b/src/core/SkRecorder.cpp @@ -186,9 +186,7 @@ void SkRecorder::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, - SK_VIRTUAL_CONSTRAINT_TYPE legacyConstraint) { - SrcRectConstraint constraint = (SrcRectConstraint)legacyConstraint; - + SrcRectConstraint constraint) { #ifdef WRAP_BITMAP_AS_IMAGE // TODO: need a way to support the flags for images... SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bitmap)); @@ -225,12 +223,8 @@ void SkRecorder::onDrawImage(const SkImage* image, SkScalar left, SkScalar top, APPEND(DrawImage, this->copy(paint), image, left, top); } -void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src, - const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { -#ifdef SK_SUPPORT_LEGACY_ONDRAWIMAGERECT - SrcRectConstraint constraint = kStrict_SrcRectConstraint; -#endif +void SkRecorder::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, + const SkPaint* paint, SrcRectConstraint constraint) { APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst, constraint); } diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h index 404d54c803..57b4568011 100644 --- a/src/core/SkRecorder.h +++ b/src/core/SkRecorder.h @@ -98,10 +98,10 @@ public: void onDrawPath(const SkPath&, const SkPaint&) override; void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, - SK_VIRTUAL_CONSTRAINT_TYPE) override; + SrcRectConstraint) override; void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, - const SkPaint* SRC_RECT_CONSTRAINT_PARAM(constraint)) override; + const SkPaint*, SrcRectConstraint) override; void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst, const SkPaint*) override; void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index e66d28f0da..867c2edac8 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1381,10 +1381,7 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, void SkGpuDevice::drawBitmapRect(const SkDraw& origDraw, const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint& paint, - SK_VIRTUAL_CONSTRAINT_TYPE legacyConstraint) { - SkCanvas::SrcRectConstraint constraint = (SkCanvas::SrcRectConstraint)legacyConstraint; - + const SkPaint& paint, SkCanvas::SrcRectConstraint constraint) { SkMatrix matrix; SkRect bitmapBounds, tmpSrc; @@ -1549,7 +1546,7 @@ void SkGpuDevice::drawImageRect(const SkDraw& draw, const SkImage* image, const SkCanvas::SrcRectConstraint constraint) { SkBitmap bm; if (wrap_as_bm(image, &bm)) { - this->drawBitmapRect(draw, bm, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE)constraint); + this->drawBitmapRect(draw, bm, src, dst, paint, constraint); } } diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index ec3bfbdaab..8d557bc6b6 100644 --- a/src/gpu/SkGpuDevice.h +++ b/src/gpu/SkGpuDevice.h @@ -95,8 +95,7 @@ public: const SkMatrix&, const SkPaint&) override; virtual void drawBitmapRect(const SkDraw&, const SkBitmap&, const SkRect* srcOrNull, const SkRect& dst, - const SkPaint& paint, - SK_VIRTUAL_CONSTRAINT_TYPE) override; + const SkPaint& paint, SkCanvas::SrcRectConstraint) override; virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, const SkPaint& paint) override; virtual void drawText(const SkDraw&, const void* text, size_t len, diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 957480d5df..fa3bc4afcc 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -1092,8 +1092,7 @@ void SkPDFDevice::drawPath(const SkDraw& d, void SkPDFDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint& srcPaint, - SK_VIRTUAL_CONSTRAINT_TYPE) { + const SkPaint& srcPaint, SkCanvas::SrcRectConstraint constraint) { SkPaint paint = srcPaint; if (bitmap.isOpaque()) { replace_srcmode_on_opaque_paint(&paint); diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h index 5c391c3ccd..32ebebd38e 100644 --- a/src/pdf/SkPDFDevice.h +++ b/src/pdf/SkPDFDevice.h @@ -93,10 +93,8 @@ public: void drawPath(const SkDraw&, const SkPath& origpath, const SkPaint& paint, const SkMatrix* prePathMatrix, bool pathIsMutable) override; - void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, - const SkRect* src, const SkRect& dst, - const SkPaint& paint, - SK_VIRTUAL_CONSTRAINT_TYPE) override; + void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, const SkRect* src, + const SkRect& dst, const SkPaint&, SkCanvas::SrcRectConstraint) override; void drawBitmap(const SkDraw&, const SkBitmap& bitmap, const SkMatrix& matrix, const SkPaint&) override; void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp index 60a63b090a..aa04cb88f3 100644 --- a/src/pipe/SkGPipeWrite.cpp +++ b/src/pipe/SkGPipeWrite.cpp @@ -276,10 +276,10 @@ protected: void onDrawPath(const SkPath&, const SkPaint&) override; void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, - SK_VIRTUAL_CONSTRAINT_TYPE) override; + SrcRectConstraint) override; void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, - const SkPaint* SRC_RECT_CONSTRAINT_PARAM(constraint)) override; + const SkPaint*, SrcRectConstraint) override; void onDrawImageNine(const SkImage*, const SkIRect& center, const SkRect& dst, const SkPaint*) override; void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, @@ -791,10 +791,7 @@ void SkGPipeCanvas::onDrawBitmap(const SkBitmap& bm, SkScalar left, SkScalar top } void SkGPipeCanvas::onDrawBitmapRect(const SkBitmap& bm, const SkRect* src, const SkRect& dst, - const SkPaint* paint, - SK_VIRTUAL_CONSTRAINT_TYPE legacyConstraint) { - SrcRectConstraint constraint = (SrcRectConstraint)legacyConstraint; - + const SkPaint* paint, SrcRectConstraint constraint) { NOTIFY_SETUP(this); size_t opBytesNeeded = sizeof(SkRect); bool hasSrc = src != NULL; @@ -872,10 +869,8 @@ void SkGPipeCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, } void SkGPipeCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { + const SkPaint* paint, SrcRectConstraint constraint) { NOTIFY_SETUP(this); - - SRC_RECT_CONSTRAINT_LOCAL_DEFAULT(constraint) unsigned flags = 0; size_t opBytesNeeded = sizeof(SkRect); // dst if (src) { diff --git a/src/svg/SkSVGDevice.cpp b/src/svg/SkSVGDevice.cpp index af565a04bd..f348c1d192 100644 --- a/src/svg/SkSVGDevice.cpp +++ b/src/svg/SkSVGDevice.cpp @@ -716,7 +716,7 @@ void SkSVGDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, void SkSVGDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bm, const SkRect* srcOrNull, const SkRect& dst, const SkPaint& paint, - SK_VIRTUAL_CONSTRAINT_TYPE) { + SkCanvas::SrcRectConstraint) { SkMatrix adjustedMatrix; adjustedMatrix.setRectToRect(srcOrNull ? *srcOrNull : SkRect::Make(bm.bounds()), dst, diff --git a/src/svg/SkSVGDevice.h b/src/svg/SkSVGDevice.h index 58fb5d4e93..31e231d926 100644 --- a/src/svg/SkSVGDevice.h +++ b/src/svg/SkSVGDevice.h @@ -36,8 +36,7 @@ protected: int x, int y, const SkPaint& paint) override; void drawBitmapRect(const SkDraw&, const SkBitmap&, const SkRect* srcOrNull, const SkRect& dst, - const SkPaint& paint, - SK_VIRTUAL_CONSTRAINT_TYPE) override; + const SkPaint& paint, SkCanvas::SrcRectConstraint) override; void drawText(const SkDraw&, const void* text, size_t len, SkScalar x, SkScalar y, const SkPaint& paint) override; diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 5ff987e0ad..52926a09f9 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -218,8 +218,7 @@ protected: const SkMatrix& matrix, const SkPaint& paint) override {SkASSERT(0);} void drawBitmapRect(const SkDraw&, const SkBitmap&, const SkRect*, - const SkRect&, const SkPaint&, - SK_VIRTUAL_CONSTRAINT_TYPE) override + const SkRect&, const SkPaint&, SkCanvas::SrcRectConstraint) override {SkASSERT(0);} void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, const SkPaint& paint) override @@ -864,7 +863,7 @@ void SkDeferredCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, void SkDeferredCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, - SK_VIRTUAL_CONSTRAINT_TYPE constraint) { + SrcRectConstraint constraint) { if (fDeferredDrawing && this->isFullFrame(&dst, paint) && SkPaintPriv::Overwrites(bitmap, paint)) { @@ -892,7 +891,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 SRC_RECT_CONSTRAINT_PARAM(constraint)) { + const SkPaint* paint, SrcRectConstraint constraint) { if (fDeferredDrawing && this->isFullFrame(&dst, paint) && SkPaintPriv::Overwrites(image, paint)) { @@ -900,8 +899,7 @@ void SkDeferredCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, } AutoImmediateDrawIfNeeded autoDraw(*this, image, paint); - this->drawingCanvas()->drawImageRect(image, src, dst, paint - SRC_RECT_CONSTRAINT_ARG(constraint)); + this->drawingCanvas()->drawImageRect(image, src, dst, paint, constraint); this->recordedDrawCommand(); } diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index e20aea4e02..e8997ab573 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -346,7 +346,7 @@ void SkDumpCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, } void SkDumpCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, SK_VIRTUAL_CONSTRAINT_TYPE) { + const SkPaint* paint, SrcRectConstraint) { SkString bs, rs; bitmap.toString(&bs); toString(dst, &rs); @@ -380,7 +380,7 @@ void SkDumpCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, con } void SkDumpCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { + const SkPaint* paint, SrcRectConstraint) { SkString bs, rs; image->toString(&bs); toString(dst, &rs); diff --git a/src/utils/SkLuaCanvas.cpp b/src/utils/SkLuaCanvas.cpp index b8921310a6..ada76666fe 100644 --- a/src/utils/SkLuaCanvas.cpp +++ b/src/utils/SkLuaCanvas.cpp @@ -215,7 +215,7 @@ void SkLuaCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, } void SkLuaCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, SK_VIRTUAL_CONSTRAINT_TYPE) { + const SkPaint* paint, SrcRectConstraint) { AUTO_LUA("drawBitmapRect"); if (paint) { lua.pushPaint(*paint, "paint"); @@ -238,7 +238,7 @@ void SkLuaCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, cons } void SkLuaCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { + const SkPaint* paint, SrcRectConstraint) { AUTO_LUA("drawImageRect"); if (paint) { lua.pushPaint(*paint, "paint"); diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp index 706c769d7b..0efc98caa5 100644 --- a/src/utils/SkNWayCanvas.cpp +++ b/src/utils/SkNWayCanvas.cpp @@ -193,7 +193,7 @@ void SkNWayCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, } void SkNWayCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, SK_VIRTUAL_CONSTRAINT_TYPE constraint) { + const SkPaint* paint, SrcRectConstraint constraint) { Iter iter(fList); while (iter.next()) { iter->drawBitmapRect(bitmap, src, dst, paint, (SrcRectConstraint)constraint); @@ -217,10 +217,10 @@ void SkNWayCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar top } void SkNWayCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { + const SkPaint* paint, SrcRectConstraint constraint) { Iter iter(fList); while (iter.next()) { - iter->drawImageRect(image, src, dst, paint SRC_RECT_CONSTRAINT_ARG(constraint)); + iter->drawImageRect(image, src, dst, paint, constraint); } } diff --git a/src/utils/SkPaintFilterCanvas.cpp b/src/utils/SkPaintFilterCanvas.cpp index 3e589e6146..0ff6ae04d1 100644 --- a/src/utils/SkPaintFilterCanvas.cpp +++ b/src/utils/SkPaintFilterCanvas.cpp @@ -74,8 +74,7 @@ void SkPaintFilterCanvas::onDrawBitmap(const SkBitmap& bm, SkScalar left, SkScal } void SkPaintFilterCanvas::onDrawBitmapRect(const SkBitmap& bm, const SkRect* src, const SkRect& dst, - const SkPaint* paint, - SK_VIRTUAL_CONSTRAINT_TYPE constraint) { + const SkPaint* paint, SrcRectConstraint constraint) { AutoPaintFilter apf(this, kBitmap_Type, paint); this->INHERITED::onDrawBitmapRect(bm, src, dst, apf.paint(), constraint); } @@ -87,11 +86,10 @@ void SkPaintFilterCanvas::onDrawImage(const SkImage* image, SkScalar left, SkSca } void SkPaintFilterCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, - const SkRect& dst, const SkPaint* paint - SRC_RECT_CONSTRAINT_PARAM(constraint)) { + const SkRect& dst, const SkPaint* paint, + SrcRectConstraint constraint) { AutoPaintFilter apf(this, kBitmap_Type, paint); - this->INHERITED::onDrawImageRect(image, src, dst, apf.paint() - SRC_RECT_CONSTRAINT_ARG(constraint)); + this->INHERITED::onDrawImageRect(image, src, dst, apf.paint(), constraint); } void SkPaintFilterCanvas::onDrawBitmapNine(const SkBitmap& bm, const SkIRect& center, diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp index 1d798787fa..1066d2b94f 100644 --- a/src/utils/debugger/SkDebugCanvas.cpp +++ b/src/utils/debugger/SkDebugCanvas.cpp @@ -415,7 +415,7 @@ void SkDebugCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left, } void SkDebugCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, SK_VIRTUAL_CONSTRAINT_TYPE constraint) { + const SkPaint* paint, SrcRectConstraint constraint) { this->addDrawCommand(new SkDrawBitmapRectCommand(bitmap, src, dst, paint, (SrcRectConstraint)constraint)); } @@ -431,8 +431,7 @@ void SkDebugCanvas::onDrawImage(const SkImage* image, SkScalar left, SkScalar to } void SkDebugCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint SRC_RECT_CONSTRAINT_PARAM(constraint)) { - SRC_RECT_CONSTRAINT_LOCAL_DEFAULT(constraint); + const SkPaint* paint, SrcRectConstraint constraint) { this->addDrawCommand(new SkDrawImageRectCommand(image, src, dst, paint, constraint)); } diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h index 4f5f226e82..e0aed6223d 100644 --- a/src/utils/debugger/SkDebugCanvas.h +++ b/src/utils/debugger/SkDebugCanvas.h @@ -198,10 +198,10 @@ protected: void onDrawPath(const SkPath&, const SkPaint&) override; void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst, const SkPaint*, - SK_VIRTUAL_CONSTRAINT_TYPE) override; + SrcRectConstraint) override; void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*) override; void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, - const SkPaint* SRC_RECT_CONSTRAINT_PARAM(constraint)) override; + const SkPaint*, SrcRectConstraint) override; void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst, const SkPaint*) override; void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) override; |