2014-04-11 18:33:31 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2014-04-10 23:30:59 +00:00
|
|
|
#include "Test.h"
|
|
|
|
|
2014-06-17 19:08:15 +00:00
|
|
|
#include "../include/record/SkRecording.h"
|
2014-04-10 23:30:59 +00:00
|
|
|
|
|
|
|
// Minimally exercise the public SkRecording API.
|
|
|
|
|
|
|
|
DEF_TEST(RecordingTest, r) {
|
2014-04-24 15:22:55 +00:00
|
|
|
EXPERIMENTAL::SkRecording recording(1920, 1080);
|
2014-04-10 23:30:59 +00:00
|
|
|
|
|
|
|
// Some very exciting commands here.
|
2014-04-24 15:22:55 +00:00
|
|
|
recording.canvas()->clipRect(SkRect::MakeWH(320, 240));
|
2014-04-10 23:30:59 +00:00
|
|
|
|
2014-04-24 15:22:55 +00:00
|
|
|
SkAutoTDelete<const EXPERIMENTAL::SkPlayback> playback(recording.releasePlayback());
|
2014-04-10 23:30:59 +00:00
|
|
|
|
|
|
|
SkCanvas target;
|
|
|
|
playback->draw(&target);
|
2014-04-24 15:22:55 +00:00
|
|
|
|
|
|
|
// 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));
|
2014-04-10 23:30:59 +00:00
|
|
|
}
|