2 * Copyright 2016 Xamarin Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
10 #include "sk_picture.h"
12 #include "sk_types_priv.h"
14 sk_picture_recorder_t* sk_picture_recorder_new() {
15 return ToPictureRecorder(new SkPictureRecorder);
18 void sk_picture_recorder_delete(sk_picture_recorder_t* crec) {
19 delete AsPictureRecorder(crec);
22 sk_canvas_t* sk_picture_recorder_begin_recording(sk_picture_recorder_t* crec,
23 const sk_rect_t* cbounds) {
24 return ToCanvas(AsPictureRecorder(crec)->beginRecording(AsRect(*cbounds)));
27 sk_picture_t* sk_picture_recorder_end_recording(sk_picture_recorder_t* crec) {
28 return ToPicture(AsPictureRecorder(crec)->finishRecordingAsPicture().release());
31 void sk_picture_ref(sk_picture_t* cpic) {
32 SkSafeRef(AsPicture(cpic));
35 void sk_picture_unref(sk_picture_t* cpic) {
36 SkSafeUnref(AsPicture(cpic));
39 uint32_t sk_picture_get_unique_id(sk_picture_t* cpic) {
40 return AsPicture(cpic)->uniqueID();
43 sk_rect_t sk_picture_get_bounds(sk_picture_t* cpic) {
44 return ToRect(AsPicture(cpic)->cullRect());