aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-06-04 05:40:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-04 05:40:44 -0700
commit9b14f26d0f3a974f3dd626c8354e1db1cfcd322f (patch)
tree542d5f1d7a1266454675745139e956b4424fde4b /tests
parent232f7259a939c70ce447a729a5094fcc272b679d (diff)
Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer)
R=reed@google.com, bsalomon@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/313613004
Diffstat (limited to 'tests')
-rw-r--r--tests/CanvasTest.cpp2
-rw-r--r--tests/ImageFilterTest.cpp12
-rw-r--r--tests/PictureStateTreeTest.cpp12
-rw-r--r--tests/PictureTest.cpp26
4 files changed, 26 insertions, 26 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 597b578e4c..e2ad2ed6b3 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -503,7 +503,7 @@ static void DrawPictureTestStep(SkCanvas* canvas,
testCanvas->drawRect(kTestRect, kTestPaint);
SkAutoTUnref<SkPicture> testPicture(recorder.endRecording());
- canvas->drawPicture(*testPicture);
+ canvas->drawPicture(testPicture);
}
TEST_STEP(DrawPicture, DrawPictureTestStep);
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 0c4d0766b5..cd6d235dc5 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -491,7 +491,7 @@ DEF_TEST(ImageFilterMatrixTest, reporter) {
recordingCanvas->restore(); // saveLayer
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas.drawPicture(*picture);
+ canvas.drawPicture(picture);
}
DEF_TEST(ImageFilterPictureImageFilterTest, reporter) {
@@ -529,7 +529,7 @@ DEF_TEST(ImageFilterPictureImageFilterTest, reporter) {
// The result here should be green, since the filter replaces the primitive's red interior.
canvas.clear(0x0);
- canvas.drawPicture(*outerPicture);
+ canvas.drawPicture(outerPicture);
uint32_t pixel = *bitmap.getAddr32(0, 0);
REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
@@ -548,7 +548,7 @@ DEF_TEST(ImageFilterPictureImageFilterTest, reporter) {
SkAutoTUnref<SkPicture> crossProcessPicture(crossProcessRecorder.endRecording());
canvas.clear(0x0);
- canvas.drawPicture(*crossProcessPicture);
+ canvas.drawPicture(crossProcessPicture);
pixel = *bitmap.getAddr32(0, 0);
// The result here should not be green, since the filter draws nothing.
REPORTER_ASSERT(reporter, pixel != SK_ColorGREEN);
@@ -584,7 +584,7 @@ DEF_TEST(ImageFilterEmptySaveLayerTest, reporter) {
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
canvas.clear(0);
- canvas.drawPicture(*picture);
+ canvas.drawPicture(picture);
uint32_t pixel = *bitmap.getAddr32(0, 0);
REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
@@ -594,7 +594,7 @@ DEF_TEST(ImageFilterEmptySaveLayerTest, reporter) {
SkAutoTUnref<SkPicture> picture2(recorder.endRecording());
canvas.clear(0);
- canvas.drawPicture(*picture2);
+ canvas.drawPicture(picture2);
pixel = *bitmap.getAddr32(0, 0);
REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
@@ -604,7 +604,7 @@ DEF_TEST(ImageFilterEmptySaveLayerTest, reporter) {
SkAutoTUnref<SkPicture> picture3(recorder.endRecording());
canvas.clear(0);
- canvas.drawPicture(*picture3);
+ canvas.drawPicture(picture3);
pixel = *bitmap.getAddr32(0, 0);
REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
}
diff --git a/tests/PictureStateTreeTest.cpp b/tests/PictureStateTreeTest.cpp
index e6cf55342e..cb154def96 100644
--- a/tests/PictureStateTreeTest.cpp
+++ b/tests/PictureStateTreeTest.cpp
@@ -84,9 +84,9 @@ static void test_reference_picture(skiatest::Reporter* reporter) {
SkCanvas bbhCanvas(bbhBitmap);
referenceCanvas.drawColor(SK_ColorTRANSPARENT);
- referenceCanvas.drawPicture(*referencePicture.get());
+ referenceCanvas.drawPicture(referencePicture.get());
bbhCanvas.drawColor(SK_ColorTRANSPARENT);
- bbhCanvas.drawPicture(*bbhPicture.get());
+ bbhCanvas.drawPicture(bbhPicture.get());
REPORTER_ASSERT(reporter,
referenceCanvas.getSaveCount() == bbhCanvas.getSaveCount());
REPORTER_ASSERT(reporter,
@@ -95,10 +95,10 @@ static void test_reference_picture(skiatest::Reporter* reporter) {
referenceCanvas.drawColor(SK_ColorTRANSPARENT);
referenceCanvas.clipRect(SkRect::MakeWH(50, 50));
- referenceCanvas.drawPicture(*referencePicture.get());
+ referenceCanvas.drawPicture(referencePicture.get());
bbhCanvas.drawColor(SK_ColorTRANSPARENT);
bbhCanvas.clipRect(SkRect::MakeWH(50, 50));
- bbhCanvas.drawPicture(*bbhPicture.get());
+ bbhCanvas.drawPicture(bbhPicture.get());
REPORTER_ASSERT(reporter,
referenceCanvas.getSaveCount() == bbhCanvas.getSaveCount());
REPORTER_ASSERT(reporter,
@@ -107,10 +107,10 @@ static void test_reference_picture(skiatest::Reporter* reporter) {
referenceCanvas.drawColor(SK_ColorTRANSPARENT);
referenceCanvas.clipRect(SkRect::MakeWH(10, 10));
- referenceCanvas.drawPicture(*referencePicture.get());
+ referenceCanvas.drawPicture(referencePicture.get());
bbhCanvas.drawColor(SK_ColorTRANSPARENT);
bbhCanvas.clipRect(SkRect::MakeWH(10, 10));
- bbhCanvas.drawPicture(*bbhPicture.get());
+ bbhCanvas.drawPicture(bbhPicture.get());
REPORTER_ASSERT(reporter,
referenceCanvas.getSaveCount() == bbhCanvas.getSaveCount());
REPORTER_ASSERT(reporter,
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 494b4ed8d4..f65c840899 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -346,7 +346,7 @@ static void draw(SkPicture* pic, int width, int height, SkBitmap* result) {
make_bm(result, width, height, SK_ColorBLACK, false);
SkCanvas canvas(*result);
- canvas.drawPicture(*pic);
+ canvas.drawPicture(pic);
}
template <typename T> int find_index(const T* array, T elem, int count) {
@@ -1066,7 +1066,7 @@ static void test_unbalanced_save_restores(skiatest::Reporter* reporter) {
canvas->drawRect(rect, paint);
SkAutoTUnref<SkPicture> extraSavePicture(recorder.endRecording());
- testCanvas.drawPicture(*extraSavePicture);
+ testCanvas.drawPicture(extraSavePicture);
REPORTER_ASSERT(reporter, 4 == testCanvas.getSaveCount());
}
@@ -1087,7 +1087,7 @@ static void test_unbalanced_save_restores(skiatest::Reporter* reporter) {
canvas->restore();
SkAutoTUnref<SkPicture> extraRestorePicture(recorder.endRecording());
- testCanvas.drawPicture(*extraRestorePicture);
+ testCanvas.drawPicture(extraRestorePicture);
REPORTER_ASSERT(reporter, 4 == testCanvas.getSaveCount());
}
@@ -1099,7 +1099,7 @@ static void test_unbalanced_save_restores(skiatest::Reporter* reporter) {
canvas->drawRect(rect, paint);
SkAutoTUnref<SkPicture> noSavePicture(recorder.endRecording());
- testCanvas.drawPicture(*noSavePicture);
+ testCanvas.drawPicture(noSavePicture);
REPORTER_ASSERT(reporter, 4 == testCanvas.getSaveCount());
REPORTER_ASSERT(reporter, testCanvas.getTotalMatrix().isIdentity());
}
@@ -1152,7 +1152,7 @@ static void test_bad_bitmap() {
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
SkCanvas canvas;
- canvas.drawPicture(*picture);
+ canvas.drawPicture(picture);
}
#endif
@@ -1247,7 +1247,7 @@ static void test_draw_empty(skiatest::Reporter* reporter) {
recorder.beginRecording(1, 1, NULL, 0);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas.drawPicture(*picture);
+ canvas.drawPicture(picture);
}
{
@@ -1262,7 +1262,7 @@ static void test_draw_empty(skiatest::Reporter* reporter) {
recorder.beginRecording(1, 1, &factory, 0);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas.drawPicture(*picture);
+ canvas.drawPicture(picture);
}
{
@@ -1272,7 +1272,7 @@ static void test_draw_empty(skiatest::Reporter* reporter) {
recorder.beginRecording(1, 1, &factory, 0);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas.drawPicture(*picture);
+ canvas.drawPicture(picture);
}
{
@@ -1282,7 +1282,7 @@ static void test_draw_empty(skiatest::Reporter* reporter) {
recorder.beginRecording(1, 1, &factory, 0);
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- canvas.drawPicture(*picture);
+ canvas.drawPicture(picture);
}
}
@@ -1460,27 +1460,27 @@ static void test_hierarchical(skiatest::Reporter* reporter) {
{
SkCanvas* canvas = recorder.beginRecording(10, 10, NULL, 0);
- canvas->drawPicture(*childPlain);
+ canvas->drawPicture(childPlain);
SkAutoTUnref<SkPicture> parentPP(recorder.endRecording());
REPORTER_ASSERT(reporter, !parentPP->willPlayBackBitmaps()); // 0
}
{
SkCanvas* canvas = recorder.beginRecording(10, 10, NULL, 0);
- canvas->drawPicture(*childWithBitmap);
+ canvas->drawPicture(childWithBitmap);
SkAutoTUnref<SkPicture> parentPWB(recorder.endRecording());
REPORTER_ASSERT(reporter, parentPWB->willPlayBackBitmaps()); // 1
}
{
SkCanvas* canvas = recorder.beginRecording(10, 10, NULL, 0);
canvas->drawBitmap(bm, 0, 0);
- canvas->drawPicture(*childPlain);
+ canvas->drawPicture(childPlain);
SkAutoTUnref<SkPicture> parentWBP(recorder.endRecording());
REPORTER_ASSERT(reporter, parentWBP->willPlayBackBitmaps()); // 1
}
{
SkCanvas* canvas = recorder.beginRecording(10, 10, NULL, 0);
canvas->drawBitmap(bm, 0, 0);
- canvas->drawPicture(*childWithBitmap);
+ canvas->drawPicture(childWithBitmap);
SkAutoTUnref<SkPicture> parentWBWB(recorder.endRecording());
REPORTER_ASSERT(reporter, parentWBWB->willPlayBackBitmaps()); // 2
}