aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-12-16 08:27:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-16 08:27:10 -0800
commit32704674f64cb6a14356dfebe060cd3484c06cc7 (patch)
tree7a72757624ed59f421c931ce5c02e7644f4987d3 /tests
parent4657ce2324ea197507c4ba728d81138f56da13b1 (diff)
Revert of remove drawSprite from canvas (patchset #4 id:60001 of https://codereview.chromium.org/1534443003/ )
Reason for revert: need to remove an override in chrome Original issue's description: > remove drawSprite from canvas > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4657ce2324ea197507c4ba728d81138f56da13b1 TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1529803004
Diffstat (limited to 'tests')
-rw-r--r--tests/ImageFilterTest.cpp10
-rw-r--r--tests/PictureTest.cpp2
-rw-r--r--tests/SurfaceTest.cpp1
3 files changed, 7 insertions, 6 deletions
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 1bf8cbdb73..6a6a7a92d6 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -977,7 +977,7 @@ static void test_huge_blur(SkCanvas* canvas, skiatest::Reporter* reporter) {
SkPaint paint;
paint.setImageFilter(blur);
- canvas->drawBitmap(bitmap, 0, 0, &paint);
+ canvas->drawSprite(bitmap, 0, 0, &paint);
}
DEF_TEST(HugeBlurImageFilter, reporter) {
@@ -1067,7 +1067,7 @@ static void test_xfermode_cropped_input(SkCanvas* canvas, skiatest::Reporter* re
SkPaint paint;
paint.setImageFilter(xfermodeNoFg);
- canvas->drawBitmap(bitmap, 0, 0, &paint); // drawSprite
+ canvas->drawSprite(bitmap, 0, 0, &paint);
uint32_t pixel;
SkImageInfo info = SkImageInfo::Make(1, 1, kBGRA_8888_SkColorType, kUnpremul_SkAlphaType);
@@ -1075,12 +1075,12 @@ static void test_xfermode_cropped_input(SkCanvas* canvas, skiatest::Reporter* re
REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
paint.setImageFilter(xfermodeNoBg);
- canvas->drawBitmap(bitmap, 0, 0, &paint); // drawSprite
+ canvas->drawSprite(bitmap, 0, 0, &paint);
canvas->readPixels(info, &pixel, 4, 0, 0);
REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
paint.setImageFilter(xfermodeNoFgNoBg);
- canvas->drawBitmap(bitmap, 0, 0, &paint); // drawSprite
+ canvas->drawSprite(bitmap, 0, 0, &paint);
canvas->readPixels(info, &pixel, 4, 0, 0);
REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
}
@@ -1128,7 +1128,7 @@ DEF_TEST(ImageFilterNestedSaveLayer, reporter) {
canvas.clear(0x0);
canvas.readPixels(info, &pixel, 4, 25, 25);
canvas.saveLayer(&bounds1, nullptr);
- canvas.drawBitmap(bitmap, 20, 20, &filterPaint); // drawSprite
+ canvas.drawSprite(bitmap, 20, 20, &filterPaint);
canvas.restore();
canvas.readPixels(info, &pixel, 4, 25, 25);
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 45a0505773..a81733e38a 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1194,7 +1194,7 @@ static void draw_bitmaps(const SkBitmap bitmap, SkCanvas* canvas) {
canvas->drawBitmap(bitmap, 0.0f, 0.0f, &paint);
canvas->drawBitmapRect(bitmap, rect, rect, &paint, SkCanvas::kStrict_SrcRectConstraint);
canvas->drawBitmapNine(bitmap, irect, rect, &paint);
- canvas->drawBitmap(bitmap, 1, 1); // drawSprite
+ canvas->drawSprite(bitmap, 1, 1);
}
static void test_draw_bitmaps(SkCanvas* canvas) {
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index f0d9b17591..6859bce6bc 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -460,6 +460,7 @@ static void test_copy_on_write(skiatest::Reporter* reporter, SkSurface* surface)
EXPECT_COPY_ON_WRITE(drawBitmap(testBitmap, 0, 0))
EXPECT_COPY_ON_WRITE(drawBitmapRect(testBitmap, testRect, nullptr))
EXPECT_COPY_ON_WRITE(drawBitmapNine(testBitmap, testIRect, testRect, nullptr))
+ EXPECT_COPY_ON_WRITE(drawSprite(testBitmap, 0, 0, nullptr))
EXPECT_COPY_ON_WRITE(drawText(testText.c_str(), testText.size(), 0, 1, testPaint))
EXPECT_COPY_ON_WRITE(drawPosText(testText.c_str(), testText.size(), testPoints2, \
testPaint))