1 /* 2 * Copyright 2014 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #include "Test.h" 9 10 #include "../include/record/SkRecording.h" 11 12 // Minimally exercise the public SkRecording API. 13 14 DEF_TEST(RecordingTest, r) { 15 EXPERIMENTAL::SkRecording recording(1920, 1080); 16 17 // Some very exciting commands here. 18 recording.canvas()->clipRect(SkRect::MakeWH(320, 240)); 19 20 SkAutoTDelete<const EXPERIMENTAL::SkPlayback> playback(recording.releasePlayback()); 21 22 SkCanvas 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)); 29 } 30