Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions display_list/dl_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@

namespace flutter {

// The primary class used to express rendering operations in the
// DisplayList ecosystem. This class is an API-only virtual class and
// can be used to talk to a DisplayListBuilder to record a series of
// rendering operations, or it could be the public facing API of an
// adapter that forwards the calls to another rendering module, like
// Skia.
//
// Developers familiar with Skia's SkCanvas API will be immediately
// familiar with the methods below as they follow that API closely
// but with DisplayList objects and values used as data instead.
//------------------------------------------------------------------------------
/// @brief Developer-facing API for rendering anything *within* the engine.
///
/// |DlCanvas| should be used to render anything in the framework classes (i.e.
/// `lib/ui`), flow and flow layers, embedders, shell, and elsewhere.
///
/// The only state carried by implementations of this interface are the clip
/// and transform which are saved and restored by the |save|, |saveLayer|, and
/// |restore| calls.
///
/// @note The interface resembles closely the familiar |SkCanvas| interface
/// used throughout the engine.
class DlCanvas {
public:
enum class ClipOp {
Expand Down
19 changes: 15 additions & 4 deletions display_list/dl_op_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ namespace flutter {
class DisplayList;

//------------------------------------------------------------------------------
/// @brief The pure virtual interface for interacting with a display list.
/// This interface represents the methods used to build a list
/// through the DisplayListBuilder and also the methods that will be
/// invoked through the DisplayList::dispatch() method.
/// @brief Internal API for rendering recorded display lists to backends.
///
/// The |DisplayList| object will play back recorded operations in this format.
/// Most developers should not needed to deal with this interface unless they
Comment thread
matanlurey marked this conversation as resolved.
Outdated
/// are writing a utility that needs to examine the contents of a display list.
///
/// Similar to |DlCanvas|, the only state carried by implementations of this
/// interface are the clip and transform which are saved and restored by the
/// |save|, |saveLayer|, and |restore| calls.
Comment thread
matanlurey marked this conversation as resolved.
Outdated
///
/// Unlike DlCanvas, this interface has attribute state which is global across
/// an entire DisplayList (not affected by save/restore).
///
/// @see DlSkCanvasDispatcher
/// @see impeller::DlDispatcher
/// @see DlOpSpy
class DlOpReceiver {
protected:
using ClipOp = DlCanvas::ClipOp;
Expand Down
6 changes: 4 additions & 2 deletions display_list/skia/dl_sk_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

namespace flutter {

// An adapter to receive DlCanvas calls and dispatch them into
// an SkCanvas.
// -----------------------------------------------------------------------------
/// @brief Backend implementation of |DlCanvas| for |SkCanvas|.
///
/// @see DlCanvas
class DlSkCanvasAdapter final : public virtual DlCanvas {
public:
DlSkCanvasAdapter() : delegate_(nullptr) {}
Expand Down
6 changes: 2 additions & 4 deletions display_list/skia/dl_sk_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
namespace flutter {

//------------------------------------------------------------------------------
/// Can be fed to the dispatch() method of a DisplayList to feed the resulting
/// rendering operations to an SkCanvas instance.
///
/// Receives all methods on Dispatcher and sends them to an SkCanvas
/// @brief Backend implementation of |DlOpReceiver| for |SkCanvas|.
///
/// @see DlOpReceiver
class DlSkCanvasDispatcher : public virtual DlOpReceiver,
public DlSkPaintDispatchHelper {
public:
Expand Down