Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1988)

Unified Diff: tests/RecordingTest.cpp

Issue 248033002: Rearrange SkRecord public API to fit better with cc/resources/picture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add forgetRecord() Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}

Powered by Google App Engine
This is Rietveld 408576698