Index: tests/CanvasTest.cpp |
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp |
index 70c2c04ffabf511239239fe8fe3cf91ab78582af..f2d3197a1206700ff5b5144d2f59a3d7257396c8 100644 |
--- a/tests/CanvasTest.cpp |
+++ b/tests/CanvasTest.cpp |
@@ -779,6 +779,32 @@ DEF_TEST(Canvas_ClipEmptyPath, reporter) { |
canvas.restore(); |
} |
+ |
robertphillips
2016/07/11 20:57:26
static
vjiaoblack
2016/07/12 13:14:22
Done.
|
+void test_updatedepth(skiatest::Reporter* reporter) { |
+ // set some depths (with picture enabled), then check them as they get set |
+ SkPictureRecorder recorder; |
+ SkCanvas* canvas; |
robertphillips
2016/07/11 20:57:26
picture isn't used
vjiaoblack
2016/07/12 13:14:22
Done.
|
+ sk_sp<SkPicture> picture; |
+ |
+ canvas = recorder.beginRecording(SkRect::MakeIWH(100, 100)); |
+ REPORTER_ASSERT(reporter, canvas->getZ() == 0); |
+ |
+ canvas->setZ(-10); |
+ REPORTER_ASSERT(reporter, canvas->getZ() == -10); |
+ |
+ canvas->save(); |
+ canvas->setZ(10); |
+ REPORTER_ASSERT(reporter, canvas->getZ() == 10); |
+ |
+ canvas->restore(); |
+ REPORTER_ASSERT(reporter, canvas->getZ() == -10); |
+ |
+ canvas->setZ(3.14); |
+ REPORTER_ASSERT(reporter, canvas->getZ() == 3.14); |
+ |
+ recorder.finishRecordingAsPicture(); |
+} |
+ |
namespace { |
class MockFilterCanvas : public SkPaintFilterCanvas { |
@@ -812,4 +838,6 @@ DEF_TEST(PaintFilterCanvas_ConsistentState, reporter) { |
REPORTER_ASSERT(reporter, canvas.getTotalMatrix() == filterCanvas.getTotalMatrix()); |
REPORTER_ASSERT(reporter, canvas.getClipBounds(&clip1) == filterCanvas.getClipBounds(&clip2)); |
REPORTER_ASSERT(reporter, clip1 == clip2); |
+ |
+ test_updatedepth(reporter); |
} |