5#include "flutter/flow/layers/display_list_layer.h"
9#include "flutter/display_list/dl_builder.h"
10#include "flutter/flow/layer_snapshot_store.h"
11#include "flutter/flow/layers/cacheable_layer.h"
12#include "flutter/flow/layers/offscreen_surface.h"
13#include "flutter/flow/raster_cache.h"
14#include "flutter/flow/raster_cache_util.h"
22 : offset_(
offset), display_list_(
std::move(display_list)) {
24 bounds_ = display_list_->bounds().makeOffset(offset_.
x(), offset_.
y());
27 display_list_, offset_, is_complex, will_change);
33 const Layer* layer)
const {
38 return old_layer !=
nullptr && offset_ == old_layer->offset_ &&
39 Compare(context->
statistics(),
this, old_layer);
51 Compare(dummy_statistics,
this,
prev));
65 const auto& dl1 = l1->display_list_;
66 const auto& dl2 = l2->display_list_;
67 if (dl1.get() == dl2.get()) {
71 const auto op_cnt_1 = dl1->op_count();
72 const auto op_cnt_2 = dl2->op_count();
73 const auto op_bytes_1 = dl1->bytes();
74 const auto op_bytes_2 = dl2->bytes();
75 if (op_cnt_1 != op_cnt_2 || op_bytes_1 != op_bytes_2 ||
76 dl1->bounds() != dl2->bounds()) {
88 auto res = dl1->Equals(*dl2);
118 if (context.raster_cache) {
121 mutator.integralTransform();
123 if (display_list_raster_cache_item_) {
125 if (display_list_raster_cache_item_->Draw(
140 auto offscreen_surface =
141 std::make_unique<OffscreenSurface>(context.
gr_context, canvas_size);
148 auto* canvas = offscreen_surface->GetCanvas();
152 canvas->SetTransform(ctm);
153 canvas->DrawDisplayList(display_list_, opacity);
160 const SkRect device_bounds =
162 sk_sp<SkData> raster_data = offscreen_surface->GetRasterData(
true);
164 raster_data, device_bounds);
static float prev(float f)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
void AddSameInstancePicture()
void AddPictureTooComplexToCompare()
void AddDifferentInstanceButEqualPicture()
void AddDeepComparePicture()
void PushTransform(const SkMatrix &transform)
void WillPaintWithIntegralTransform()
void AddLayerBounds(const SkRect &rect)
void SetLayerPaintRegion(const Layer *layer, const PaintRegion ®ion)
Statistics & statistics()
PaintRegion CurrentSubtreeRegion() const
bool has_raster_cache() const
bool IsSubtreeDirty() const
bool IsReplacing(DiffContext *context, const Layer *layer) const override
void Preroll(PrerollContext *frame) override
void Diff(DiffContext *context, const Layer *old_layer) override
DisplayList * display_list() const
DisplayListLayer(const SkPoint &offset, sk_sp< DisplayList > display_list, bool is_complex, bool will_change)
static constexpr size_t kMaxBytesToCompare
void Paint(PaintContext &context) const override
static std::unique_ptr< DisplayListRasterCacheItem > Make(const sk_sp< DisplayList > &, const SkPoint &offset, bool is_complex, bool will_change)
bool can_apply_group_opacity() const
virtual SkISize GetBaseLayerSize() const =0
virtual void DrawDisplayList(const sk_sp< DisplayList > display_list, SkScalar opacity=SK_Scalar1)=0
virtual SkMatrix GetTransform() const =0
void Add(const LayerSnapshotData &data)
void translate(SkScalar tx, SkScalar ty)
SkMatrix transform_3x3() const
void fill(MutatorsStack *mutators)
SkScalar outstanding_opacity() const
static constexpr int kCallerCanApplyOpacity
const SkRect & paint_bounds() const
bool needs_painting(PaintContext &context) const
virtual const DisplayListLayer * as_display_list_layer() const
uint64_t unique_id() const
void set_paint_bounds(const SkRect &paint_bounds)
#define FML_DCHECK(condition)
Optional< SkRect > bounds
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
constexpr float y() const
constexpr float x() const
static constexpr DlColor kTransparent()
bool enable_leaf_layer_tracing
LayerSnapshotStore * layer_snapshot_store
GrDirectContext * gr_context
LayerStateStack & state_stack
LayerStateStack & state_stack
int renderable_state_flags
static SkRect GetDeviceBounds(const SkRect &rect, const SkMatrix &ctm)
#define TRACE_EVENT_INSTANT0(category_group, name)