stop using drawSprite (at least w/ no filters) as it is going away

BUG=skia:

Review URL: https://codereview.chromium.org/1411173010
This commit is contained in:
reed 2015-11-02 12:11:13 -08:00 committed by Commit bot
parent 8de01c642c
commit 4a21602982
5 changed files with 9 additions and 12 deletions

View File

@ -440,14 +440,10 @@ protected:
canvas->drawPath(path, paint);
paint.setShader(nullptr);
// bitmap, sprite
// bitmap
canvas->translate(SkIntToScalar(50), 0);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawBitmap(fBug, left, top, &paint);
canvas->translate(SkIntToScalar(30), 0);
canvas->drawSprite(fTb,
SkScalarRoundToInt(canvas->getTotalMatrix().getTranslateX()),
spriteOffset + 10, &paint);
canvas->translate(-SkIntToScalar(30), SkIntToScalar(30));
paint.setShader(shaderTest())->unref(); // test compose shader

View File

@ -79,7 +79,8 @@ bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
paint.setColorFilter(fColorFilter);
canvas.drawSprite(src, srcOffset.fX - bounds.fLeft, srcOffset.fY - bounds.fTop, &paint);
canvas.drawBitmap(src, SkIntToScalar(srcOffset.fX - bounds.fLeft),
SkIntToScalar(srcOffset.fY - bounds.fTop), &paint);
*result = device.get()->accessBitmap(false);
offset->fX = bounds.fLeft;

View File

@ -91,7 +91,7 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
} else {
paint.setXfermode(nullptr);
}
canvas.drawSprite(input, pos.x() - x0, pos.y() - y0, &paint);
canvas.drawBitmap(input, SkIntToScalar(pos.x() - x0), SkIntToScalar(pos.y() - y0), &paint);
didProduceResult = true;
}

View File

@ -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->drawSprite(bm,
layer->srcIR().fLeft + layer->offset().fX,
layer->srcIR().fTop + layer->offset().fY,
canvas->drawBitmap(bm,
SkIntToScalar(layer->srcIR().fLeft + layer->offset().fX),
SkIntToScalar(layer->srcIR().fTop + layer->offset().fY),
layer->paint());
}
}

View File

@ -206,8 +206,8 @@ bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize,
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
SkCanvas canvas(*dst);
canvas.drawSprite(*src, (srcX - dstX) / sampleSize,
(srcY - dstY) / sampleSize,
canvas.drawBitmap(*src, SkIntToScalar((srcX - dstX) / sampleSize),
SkIntToScalar((srcY - dstY) / sampleSize),
&paint);
return true;
}