diff options
author | reed <reed@google.com> | 2015-11-03 11:27:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-03 11:27:07 -0800 |
commit | 67b8b5e67a427382fed8c5d8b3c70a21ed2492c6 (patch) | |
tree | 3000bc4503b587abf98253178e38fcad5ed4eb27 /src | |
parent | 4a40a46c654f292b9407fe42012831855411f75e (diff) |
Revert of Revert[2] of "stop using drawSprite (at least w/ no filters) as it is going away" (patchset #1 id:1 of https://codereview.chromium.org/1410343011/ )
Reason for revert:
failing on msaa
Original issue's description:
> Revert[2] of "stop using drawSprite (at least w/ no filters) as it is going away"
>
> Fixed assert in test that was calling GrRecordReplaceDraw(). That function now uses
> drawBitmap, so updated the test to check for that (instead of drawSprite).
>
> This reverts commit 21b766347064837e6b78d600755901aad88cd6e0.
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/7b81994d95f10cda80ddb85af68a2651ff31782f
TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1420053009
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkColorFilterImageFilter.cpp | 3 | ||||
-rwxr-xr-x | src/effects/SkMergeImageFilter.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrRecordReplaceDraw.cpp | 6 | ||||
-rw-r--r-- | src/images/SkImageDecoder.cpp | 4 |
4 files changed, 7 insertions, 8 deletions
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index 8d394aa17b..acdb6ab7a7 100644 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -79,8 +79,7 @@ bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc paint.setXfermodeMode(SkXfermode::kSrc_Mode); paint.setColorFilter(fColorFilter); - canvas.drawBitmap(src, SkIntToScalar(srcOffset.fX - bounds.fLeft), - SkIntToScalar(srcOffset.fY - bounds.fTop), &paint); + canvas.drawSprite(src, srcOffset.fX - bounds.fLeft, srcOffset.fY - bounds.fTop, &paint); *result = device.get()->accessBitmap(false); offset->fX = bounds.fLeft; diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp index d6f0eaa794..e99991898c 100755 --- a/src/effects/SkMergeImageFilter.cpp +++ b/src/effects/SkMergeImageFilter.cpp @@ -91,7 +91,7 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, } else { paint.setXfermode(nullptr); } - canvas.drawBitmap(input, SkIntToScalar(pos.x() - x0), SkIntToScalar(pos.y() - y0), &paint); + canvas.drawSprite(input, pos.x() - x0, pos.y() - y0, &paint); didProduceResult = true; } diff --git a/src/gpu/GrRecordReplaceDraw.cpp b/src/gpu/GrRecordReplaceDraw.cpp index d5ddbd0788..bca9255856 100644 --- a/src/gpu/GrRecordReplaceDraw.cpp +++ b/src/gpu/GrRecordReplaceDraw.cpp @@ -46,9 +46,9 @@ static inline void draw_replacement_bitmap(GrCachedLayer* layer, SkCanvas* canva canvas->drawBitmapRect(bm, src, dst, layer->paint(), SkCanvas::kStrict_SrcRectConstraint); canvas->restore(); } else { - canvas->drawBitmap(bm, - SkIntToScalar(layer->srcIR().fLeft + layer->offset().fX), - SkIntToScalar(layer->srcIR().fTop + layer->offset().fY), + canvas->drawSprite(bm, + layer->srcIR().fLeft + layer->offset().fX, + layer->srcIR().fTop + layer->offset().fY, layer->paint()); } } diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp index 60cc44c5b4..daeee9f0b9 100644 --- a/src/images/SkImageDecoder.cpp +++ b/src/images/SkImageDecoder.cpp @@ -206,8 +206,8 @@ bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize, paint.setXfermodeMode(SkXfermode::kSrc_Mode); SkCanvas canvas(*dst); - canvas.drawBitmap(*src, SkIntToScalar((srcX - dstX) / sampleSize), - SkIntToScalar((srcY - dstY) / sampleSize), + canvas.drawSprite(*src, (srcX - dstX) / sampleSize, + (srcY - dstY) / sampleSize, &paint); return true; } |