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 21b7663470
.
>
> 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
This commit is contained in:
parent
4a40a46c65
commit
67b8b5e67a
@ -440,10 +440,14 @@ protected:
|
|||||||
canvas->drawPath(path, paint);
|
canvas->drawPath(path, paint);
|
||||||
|
|
||||||
paint.setShader(nullptr);
|
paint.setShader(nullptr);
|
||||||
// bitmap
|
// bitmap, sprite
|
||||||
canvas->translate(SkIntToScalar(50), 0);
|
canvas->translate(SkIntToScalar(50), 0);
|
||||||
paint.setStyle(SkPaint::kFill_Style);
|
paint.setStyle(SkPaint::kFill_Style);
|
||||||
canvas->drawBitmap(fBug, left, top, &paint);
|
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));
|
canvas->translate(-SkIntToScalar(30), SkIntToScalar(30));
|
||||||
paint.setShader(shaderTest())->unref(); // test compose shader
|
paint.setShader(shaderTest())->unref(); // test compose shader
|
||||||
|
@ -79,8 +79,7 @@ bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc
|
|||||||
|
|
||||||
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
|
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
|
||||||
paint.setColorFilter(fColorFilter);
|
paint.setColorFilter(fColorFilter);
|
||||||
canvas.drawBitmap(src, SkIntToScalar(srcOffset.fX - bounds.fLeft),
|
canvas.drawSprite(src, srcOffset.fX - bounds.fLeft, srcOffset.fY - bounds.fTop, &paint);
|
||||||
SkIntToScalar(srcOffset.fY - bounds.fTop), &paint);
|
|
||||||
|
|
||||||
*result = device.get()->accessBitmap(false);
|
*result = device.get()->accessBitmap(false);
|
||||||
offset->fX = bounds.fLeft;
|
offset->fX = bounds.fLeft;
|
||||||
|
@ -91,7 +91,7 @@ bool SkMergeImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
|
|||||||
} else {
|
} else {
|
||||||
paint.setXfermode(nullptr);
|
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;
|
didProduceResult = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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->drawBitmapRect(bm, src, dst, layer->paint(), SkCanvas::kStrict_SrcRectConstraint);
|
||||||
canvas->restore();
|
canvas->restore();
|
||||||
} else {
|
} else {
|
||||||
canvas->drawBitmap(bm,
|
canvas->drawSprite(bm,
|
||||||
SkIntToScalar(layer->srcIR().fLeft + layer->offset().fX),
|
layer->srcIR().fLeft + layer->offset().fX,
|
||||||
SkIntToScalar(layer->srcIR().fTop + layer->offset().fY),
|
layer->srcIR().fTop + layer->offset().fY,
|
||||||
layer->paint());
|
layer->paint());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,8 +206,8 @@ bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize,
|
|||||||
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
|
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
|
||||||
|
|
||||||
SkCanvas canvas(*dst);
|
SkCanvas canvas(*dst);
|
||||||
canvas.drawBitmap(*src, SkIntToScalar((srcX - dstX) / sampleSize),
|
canvas.drawSprite(*src, (srcX - dstX) / sampleSize,
|
||||||
SkIntToScalar((srcY - dstY) / sampleSize),
|
(srcY - dstY) / sampleSize,
|
||||||
&paint);
|
&paint);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ void test_replacements(skiatest::Reporter* r, GrContext* context, bool useBBH) {
|
|||||||
assert_type<SkRecords::Save>(r, rerecord, 0);
|
assert_type<SkRecords::Save>(r, rerecord, 0);
|
||||||
index += 1;
|
index += 1;
|
||||||
}
|
}
|
||||||
assert_type<SkRecords::DrawBitmap>(r, rerecord, index + 0);
|
assert_type<SkRecords::DrawSprite>(r, rerecord, index + 0);
|
||||||
assert_type<SkRecords::DrawRect>(r, rerecord, index + 1);
|
assert_type<SkRecords::DrawRect>(r, rerecord, index + 1);
|
||||||
if (4 == recount) {
|
if (4 == recount) {
|
||||||
assert_type<SkRecords::Restore>(r, rerecord, 3);
|
assert_type<SkRecords::Restore>(r, rerecord, 3);
|
||||||
|
Loading…
Reference in New Issue
Block a user