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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 9
10 #include "SkRecording.h" 10 #include "SkRecording.h"
11 11
12 // Minimally exercise the public SkRecording API. 12 // Minimally exercise the public SkRecording API.
13 13
14 DEF_TEST(RecordingTest, r) { 14 DEF_TEST(RecordingTest, r) {
15 EXPERIMENTAL::SkRecording* recording = EXPERIMENTAL::SkRecording::Create(192 0, 1080); 15 EXPERIMENTAL::SkRecording recording(1920, 1080);
16 16
17 // Some very exciting commands here. 17 // Some very exciting commands here.
18 recording->canvas()->clipRect(SkRect::MakeWH(320, 240)); 18 recording.canvas()->clipRect(SkRect::MakeWH(320, 240));
19 19
20 SkAutoTDelete<const EXPERIMENTAL::SkPlayback> playback( 20 SkAutoTDelete<const EXPERIMENTAL::SkPlayback> playback(recording.releasePlay back());
21 EXPERIMENTAL::SkRecording::Delete(recording));
22 21
23 SkCanvas target; 22 SkCanvas target;
24 playback->draw(&target); 23 playback->draw(&target);
24
25 // Here's another recording we never call releasePlayback().
26 // However pointless, this should be safe.
27 EXPERIMENTAL::SkRecording pointless(1920, 1080);
28 pointless.canvas()->clipRect(SkRect::MakeWH(320, 240));
25 } 29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698