Flutter Engine
The Flutter Engine
|
#include <SkPictureRecorder.h>
Public Member Functions | |
SkPictureRecorder () | |
~SkPictureRecorder () | |
SkCanvas * | beginRecording (const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh) |
SkCanvas * | beginRecording (const SkRect &bounds, SkBBHFactory *bbhFactory=nullptr) |
SkCanvas * | beginRecording (SkScalar width, SkScalar height, SkBBHFactory *bbhFactory=nullptr) |
SkCanvas * | getRecordingCanvas () |
sk_sp< SkPicture > | finishRecordingAsPicture () |
sk_sp< SkPicture > | finishRecordingAsPictureWithCull (const SkRect &cullRect) |
sk_sp< SkDrawable > | finishRecordingAsDrawable () |
Friends | |
class | SkPictureRecorderReplayTester |
Definition at line 32 of file SkPictureRecorder.h.
SkPictureRecorder::SkPictureRecorder | ( | ) |
Definition at line 28 of file SkPictureRecorder.cpp.
SkPictureRecorder::~SkPictureRecorder | ( | ) |
Definition at line 33 of file SkPictureRecorder.cpp.
SkCanvas * SkPictureRecorder::beginRecording | ( | const SkRect & | bounds, |
sk_sp< SkBBoxHierarchy > | bbh | ||
) |
Returns the canvas that records the drawing commands.
bounds | the cull rect used when recording this picture. Any drawing the falls outside of this rect is undefined, and may be drawn or it may not. |
bbh | optional acceleration structure |
recordFlags | optional flags that control recording. |
Definition at line 35 of file SkPictureRecorder.cpp.
SkCanvas * SkPictureRecorder::beginRecording | ( | const SkRect & | bounds, |
SkBBHFactory * | bbhFactory = nullptr |
||
) |
Definition at line 50 of file SkPictureRecorder.cpp.
|
inline |
Definition at line 48 of file SkPictureRecorder.h.
sk_sp< SkDrawable > SkPictureRecorder::finishRecordingAsDrawable | ( | ) |
Signal that the caller is done recording. This invalidates the canvas returned by beginRecording/getRecordingCanvas. Ownership of the object is passed to the caller, who must call unref() when they are done using it.
Unlike finishRecordingAsPicture(), which returns an immutable picture, the returned drawable may contain live references to other drawables (if they were added to the recording canvas) and therefore this drawable will reflect the current state of those nested drawables anytime it is drawn or a new picture is snapped from it (by calling drawable->makePictureSnapshot()).
Definition at line 132 of file SkPictureRecorder.cpp.
Signal that the caller is done recording. This invalidates the canvas returned by beginRecording/getRecordingCanvas. Ownership of the object is passed to the caller, who must call unref() when they are done using it.
The returned picture is immutable. If during recording drawables were added to the canvas, these will have been "drawn" into a recording canvas, so that this resulting picture will reflect their current state, but will not contain a live reference to the drawables themselves.
Definition at line 67 of file SkPictureRecorder.cpp.
Signal that the caller is done recording, and update the cull rect to use for bounding box hierarchy (BBH) generation. The behavior is the same as calling finishRecordingAsPicture(), except that this method updates the cull rect initially passed into beginRecording.
cullRect | the new culling rectangle to use as the overall bound for BBH generation and subsequent culling operations. |
Definition at line 111 of file SkPictureRecorder.cpp.
SkCanvas * SkPictureRecorder::getRecordingCanvas | ( | ) |
Returns the recording canvas if one is active, or NULL if recording is not active. This does not alter the refcnt on the canvas (if present).
Definition at line 54 of file SkPictureRecorder.cpp.
|
friend |
Replay the current (partially recorded) operation stream into canvas. This call doesn't close the current recording.
Definition at line 102 of file SkPictureRecorder.h.