Flutter Engine
The Flutter Engine
picture.cpp
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "export.h"
6#include "helpers.h"
10#include "wrappers.h"
11
12using namespace Skwasm;
13
15
17 return new SkPictureRecorder();
18}
19
21 delete recorder;
22}
23
25 SkPictureRecorder* recorder,
26 const SkRect* cullRect) {
27 return recorder->beginRecording(*cullRect, &bbhFactory);
28}
29
31 SkPictureRecorder* recorder) {
32 return recorder->finishRecordingAsPicture().release();
33}
34
36 *outRect = picture->cullRect();
37}
38
40 picture->unref();
41}
42
44 return static_cast<uint32_t>(picture->approximateBytesUsed());
45}
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
virtual SkRect cullRect() const =0
virtual size_t approximateBytesUsed() const =0
void unref() const
Definition: SkRefCnt.h:72
T * release()
Definition: SkRefCnt.h:324
SKWASM_EXPORT uint32_t picture_approximateBytesUsed(SkPicture *picture)
Definition: picture.cpp:43
SKWASM_EXPORT SkPicture * pictureRecorder_endRecording(SkPictureRecorder *recorder)
Definition: picture.cpp:30
SKWASM_EXPORT void picture_dispose(SkPicture *picture)
Definition: picture.cpp:39
SkRTreeFactory bbhFactory
Definition: picture.cpp:14
SKWASM_EXPORT void picture_getCullRect(SkPicture *picture, SkRect *outRect)
Definition: picture.cpp:35
SKWASM_EXPORT SkCanvas * pictureRecorder_beginRecording(SkPictureRecorder *recorder, const SkRect *cullRect)
Definition: picture.cpp:24
SKWASM_EXPORT SkPictureRecorder * pictureRecorder_create()
Definition: picture.cpp:16
SKWASM_EXPORT void pictureRecorder_dispose(SkPictureRecorder *recorder)
Definition: picture.cpp:20
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299
Definition: helpers.h:12
#define SKWASM_EXPORT
Definition: export.h:10