Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::CompositorContext::ScopedFrame Class Reference

#include <compositor_context.h>

Public Member Functions

 ScopedFrame (CompositorContext &context, GrDirectContext *gr_context, DlCanvas *canvas, ExternalViewEmbedder *view_embedder, const SkMatrix &root_surface_transformation, bool instrumentation_enabled, bool surface_supports_readback, fml::RefPtr< fml::RasterThreadMerger > raster_thread_merger, impeller::AiksContext *aiks_context)
 
virtual ~ScopedFrame ()
 
DlCanvascanvas ()
 
ExternalViewEmbedderview_embedder ()
 
CompositorContextcontext () const
 
const SkMatrixroot_surface_transformation () const
 
bool surface_supports_readback ()
 
GrDirectContextgr_context () const
 
impeller::AiksContextaiks_context () const
 
virtual RasterStatus Raster (LayerTree &layer_tree, bool ignore_raster_cache, FrameDamage *frame_damage)
 

Detailed Description

Definition at line 109 of file compositor_context.h.

Constructor & Destructor Documentation

◆ ScopedFrame()

flutter::CompositorContext::ScopedFrame::ScopedFrame ( CompositorContext context,
GrDirectContext gr_context,
DlCanvas canvas,
ExternalViewEmbedder view_embedder,
const SkMatrix root_surface_transformation,
bool  instrumentation_enabled,
bool  surface_supports_readback,
fml::RefPtr< fml::RasterThreadMerger raster_thread_merger,
impeller::AiksContext aiks_context 
)

Definition at line 91 of file compositor_context.cc.

101 : context_(context),
102 gr_context_(gr_context),
103 canvas_(canvas),
104 aiks_context_(aiks_context),
105 view_embedder_(view_embedder),
106 root_surface_transformation_(root_surface_transformation),
107 instrumentation_enabled_(instrumentation_enabled),
108 surface_supports_readback_(surface_supports_readback),
109 raster_thread_merger_(std::move(raster_thread_merger)) {
110 context_.BeginFrame(*this, instrumentation_enabled_);
111}
impeller::AiksContext * aiks_context() const
const SkMatrix & root_surface_transformation() const

◆ ~ScopedFrame()

flutter::CompositorContext::ScopedFrame::~ScopedFrame ( )
virtual

Definition at line 113 of file compositor_context.cc.

113 {
114 context_.EndFrame(*this, instrumentation_enabled_);
115}

Member Function Documentation

◆ aiks_context()

impeller::AiksContext * flutter::CompositorContext::ScopedFrame::aiks_context ( ) const
inline

Definition at line 137 of file compositor_context.h.

137{ return aiks_context_; }

◆ canvas()

DlCanvas * flutter::CompositorContext::ScopedFrame::canvas ( )
inline

Definition at line 123 of file compositor_context.h.

123{ return canvas_; }

◆ context()

CompositorContext & flutter::CompositorContext::ScopedFrame::context ( ) const
inline

Definition at line 127 of file compositor_context.h.

127{ return context_; }

◆ gr_context()

GrDirectContext * flutter::CompositorContext::ScopedFrame::gr_context ( ) const
inline

Definition at line 135 of file compositor_context.h.

135{ return gr_context_; }

◆ Raster()

RasterStatus flutter::CompositorContext::ScopedFrame::Raster ( flutter::LayerTree layer_tree,
bool  ignore_raster_cache,
FrameDamage frame_damage 
)
virtual

Definition at line 117 of file compositor_context.cc.

120 {
121 TRACE_EVENT0("flutter", "CompositorContext::ScopedFrame::Raster");
122
123 std::optional<SkRect> clip_rect;
124 if (frame_damage) {
125 clip_rect = frame_damage->ComputeClipRect(layer_tree, !ignore_raster_cache,
126 !gr_context_);
127
128 if (aiks_context_ &&
129 !ShouldPerformPartialRepaint(clip_rect, layer_tree.frame_size())) {
130 clip_rect = std::nullopt;
131 frame_damage->Reset();
132 }
133 }
134
135 bool root_needs_readback = layer_tree.Preroll(
136 *this, ignore_raster_cache, clip_rect ? *clip_rect : kGiantRect);
137 bool needs_save_layer = root_needs_readback && !surface_supports_readback();
139 if (view_embedder_ && raster_thread_merger_) {
140 post_preroll_result =
141 view_embedder_->PostPrerollAction(raster_thread_merger_);
142 }
143
144 if (post_preroll_result == PostPrerollResult::kResubmitFrame) {
146 }
147 if (post_preroll_result == PostPrerollResult::kSkipAndRetryFrame) {
149 }
150
151 if (aiks_context_) {
152 PaintLayerTreeImpeller(layer_tree, clip_rect, ignore_raster_cache);
153 } else {
154 PaintLayerTreeSkia(layer_tree, clip_rect, needs_save_layer,
155 ignore_raster_cache);
156 }
158}
virtual PostPrerollResult PostPrerollAction(const fml::RefPtr< fml::RasterThreadMerger > &raster_thread_merger)
bool Preroll(CompositorContext::ScopedFrame &frame, bool ignore_raster_cache=false, SkRect cull_rect=kGiantRect)
Definition: layer_tree.cc:29
const SkISize & frame_size() const
Definition: layer_tree.h:54
static constexpr SkRect kGiantRect
Definition: layer.h:50
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:131

◆ root_surface_transformation()

const SkMatrix & flutter::CompositorContext::ScopedFrame::root_surface_transformation ( ) const
inline

Definition at line 129 of file compositor_context.h.

129 {
130 return root_surface_transformation_;
131 }

◆ surface_supports_readback()

bool flutter::CompositorContext::ScopedFrame::surface_supports_readback ( )
inline

Definition at line 133 of file compositor_context.h.

133{ return surface_supports_readback_; }

◆ view_embedder()

ExternalViewEmbedder * flutter::CompositorContext::ScopedFrame::view_embedder ( )
inline

Definition at line 125 of file compositor_context.h.

125{ return view_embedder_; }

The documentation for this class was generated from the following files: