Index: tests/RecordingTest.cpp |
diff --git a/tests/RecordingTest.cpp b/tests/RecordingTest.cpp |
index 7d1dbf1a449bdb6d71b93702d74728c7089eb095..fbe8448359a730dcf95021f44853527a6787b6ad 100644 |
--- a/tests/RecordingTest.cpp |
+++ b/tests/RecordingTest.cpp |
@@ -12,14 +12,18 @@ |
// Minimally exercise the public SkRecording API. |
DEF_TEST(RecordingTest, r) { |
- EXPERIMENTAL::SkRecording* recording = EXPERIMENTAL::SkRecording::Create(1920, 1080); |
+ EXPERIMENTAL::SkRecording recording(1920, 1080); |
// Some very exciting commands here. |
- recording->canvas()->clipRect(SkRect::MakeWH(320, 240)); |
+ recording.canvas()->clipRect(SkRect::MakeWH(320, 240)); |
- SkAutoTDelete<const EXPERIMENTAL::SkPlayback> playback( |
- EXPERIMENTAL::SkRecording::Delete(recording)); |
+ SkAutoTDelete<const EXPERIMENTAL::SkPlayback> playback(recording.releasePlayback()); |
SkCanvas target; |
playback->draw(&target); |
+ |
+ // Here's another recording we never call releasePlayback(). |
+ // However pointless, this should be safe. |
+ EXPERIMENTAL::SkRecording pointless(1920, 1080); |
+ pointless.canvas()->clipRect(SkRect::MakeWH(320, 240)); |
} |