aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-09-04 08:42:50 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-04 08:42:50 -0700
commitc5ba71d2e5cd426def66fa49dcf003e5b2c98dc7 (patch)
tree120359b17c8143f85462fefd855d2d94b50ce785 /tests
parent227c54e3d4e7b738d0b11a2f68b63cb1fd79cb12 (diff)
Change SkPicture::draw to playback
R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/540963002
Diffstat (limited to 'tests')
-rwxr-xr-xtests/PathOpsSkpClipTest.cpp4
-rw-r--r--tests/PictureTest.cpp10
-rw-r--r--tests/SerializationTest.cpp2
-rw-r--r--tests/TileGridTest.cpp28
4 files changed, 22 insertions, 22 deletions
diff --git a/tests/PathOpsSkpClipTest.cpp b/tests/PathOpsSkpClipTest.cpp
index 0769141685..b8142cd654 100755
--- a/tests/PathOpsSkpClipTest.cpp
+++ b/tests/PathOpsSkpClipTest.cpp
@@ -400,7 +400,7 @@ static SkMSec timePict(SkPicture* pic, SkCanvas* canvas) {
SkMSec start = SkTime::GetMSecs();
for (int x = 0; x < slices; ++x) {
for (int y = 0; y < slices; ++y) {
- pic->draw(canvas);
+ pic->playback(canvas);
canvas->translate(0, yInterval);
}
canvas->translate(xInterval, -yInterval * slices);
@@ -416,7 +416,7 @@ static void drawPict(SkPicture* pic, SkCanvas* canvas, int scale) {
canvas->save();
canvas->scale(1.0f / scale, 1.0f / scale);
}
- pic->draw(canvas);
+ pic->playback(canvas);
if (scale != 1) {
canvas->restore();
}
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 8b19df2161..eb85c94a69 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1191,7 +1191,7 @@ void check_save_state(skiatest::Reporter* reporter, SkPicture* picture,
SaveCountingCanvas canvas(SkScalarCeilToInt(picture->cullRect().width()),
SkScalarCeilToInt(picture->cullRect().height()));
- picture->draw(&canvas);
+ picture->playback(&canvas);
REPORTER_ASSERT(reporter, numSaves == canvas.getSaveCount());
REPORTER_ASSERT(reporter, numSaveLayers == canvas.getSaveLayerCount());
@@ -1693,7 +1693,7 @@ static void test_clip_expansion(skiatest::Reporter* reporter) {
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
ClipCountingCanvas testCanvas(10, 10);
- picture->draw(&testCanvas);
+ picture->playback(&testCanvas);
// Both clips should be present on playback.
REPORTER_ASSERT(reporter, testCanvas.getClipCount() == 2);
@@ -1866,7 +1866,7 @@ DEF_TEST(DontOptimizeSaveLayerDrawDrawRestore, reporter) {
SkBitmap replayBM;
make_bm(&replayBM, 100, 100, SK_ColorBLACK, false);
SkCanvas replayCanvas(replayBM);
- picture->draw(&replayCanvas);
+ picture->playback(&replayCanvas);
replayCanvas.flush();
// With the bug present, at (55, 55) we would get a fully opaque red
@@ -1914,10 +1914,10 @@ DEF_TEST(Picture_SkipBBH, r) {
SkCanvas big(640, 480), small(300, 200);
- picture->draw(&big);
+ picture->playback(&big);
REPORTER_ASSERT(r, bbh.searchCalls == 0);
- picture->draw(&small);
+ picture->playback(&small);
REPORTER_ASSERT(r, bbh.searchCalls == 1);
}
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index ea03e875a2..b5582dccfc 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -266,7 +266,7 @@ static SkBitmap draw_picture(SkPicture& picture) {
bitmap.allocN32Pixels(SkScalarCeilToInt(picture.cullRect().width()),
SkScalarCeilToInt(picture.cullRect().height()));
SkCanvas canvas(bitmap);
- picture.draw(&canvas);
+ picture.playback(&canvas);
return bitmap;
}
diff --git a/tests/TileGridTest.cpp b/tests/TileGridTest.cpp
index 81f383d97e..16434abdc6 100644
--- a/tests/TileGridTest.cpp
+++ b/tests/TileGridTest.cpp
@@ -73,14 +73,14 @@ DEF_TEST(TileGrid_UnalignedQuery, reporter) {
// Test parts of top-left tile
{
MockCanvas mockCanvas(store);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
}
{
MockCanvas mockCanvas(store);
mockCanvas.translate(-7.99f, -7.99f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
}
@@ -88,7 +88,7 @@ DEF_TEST(TileGrid_UnalignedQuery, reporter) {
{
MockCanvas mockCanvas(store);
mockCanvas.translate(-9.5f, -9.5f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 2 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[1]);
@@ -97,7 +97,7 @@ DEF_TEST(TileGrid_UnalignedQuery, reporter) {
{
MockCanvas mockCanvas(store);
mockCanvas.translate(-16.0f, -16.0f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[0]);
}
@@ -105,28 +105,28 @@ DEF_TEST(TileGrid_UnalignedQuery, reporter) {
{
MockCanvas mockCanvas(store);
mockCanvas.translate(2.0f, 0.0f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
}
{
MockCanvas mockCanvas(store);
mockCanvas.translate(0.0f, 2.0f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
}
{
MockCanvas mockCanvas(store);
mockCanvas.translate(-22.0f, -16.0f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[0]);
}
{
MockCanvas mockCanvas(store);
mockCanvas.translate(-16.0f, -22.0f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[0]);
}
@@ -168,14 +168,14 @@ DEF_TEST(TileGrid_OverlapOffsetQueryAlignment, reporter) {
// The offset should cancel the top and left borders of the top left tile
// So a look-up at interval 0-10 should be grid aligned,
MockCanvas mockCanvas(tileBitmap);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
}
{
// Encroaching border by one pixel
MockCanvas mockCanvas(moreThanATileBitmap);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 2 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[1]);
@@ -186,14 +186,14 @@ DEF_TEST(TileGrid_OverlapOffsetQueryAlignment, reporter) {
// with middle tile.
MockCanvas mockCanvas(tileBitmap);
mockCanvas.translate(SkIntToScalar(-8), SkIntToScalar(-8));
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 1 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[0]);
}
{
MockCanvas mockCanvas(tileBitmap);
mockCanvas.translate(-7.9f, -7.9f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 2 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect1 == mockCanvas.fRects[0]);
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[1]);
@@ -201,7 +201,7 @@ DEF_TEST(TileGrid_OverlapOffsetQueryAlignment, reporter) {
{
MockCanvas mockCanvas(tileBitmap);
mockCanvas.translate(-8.1f, -8.1f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
REPORTER_ASSERT(reporter, 2 == mockCanvas.fRects.count());
REPORTER_ASSERT(reporter, rect2 == mockCanvas.fRects[0]);
REPORTER_ASSERT(reporter, rect3 == mockCanvas.fRects[1]);
@@ -212,7 +212,7 @@ DEF_TEST(TileGrid_OverlapOffsetQueryAlignment, reporter) {
// adjusted region, sitting right on top of the tile boundary.
MockCanvas mockCanvas(tinyBitmap);
mockCanvas.translate(-8.0f, -8.0f);
- picture->draw(&mockCanvas);
+ picture->playback(&mockCanvas);
// This test passes by not asserting. We do not validate the rects recorded
// because the result is numerically unstable (floating point equality).
// The content of any one of the four tiles of the tilegrid would be a valid