5#ifndef FLUTTER_FLOW_LAYERS_LAYER_H_
6#define FLUTTER_FLOW_LAYERS_LAYER_H_
10#include <unordered_set>
13#include "flutter/common/graphics/texture.h"
14#include "flutter/common/macros.h"
15#include "flutter/display_list/dl_canvas.h"
16#include "flutter/flow/diff_context.h"
17#include "flutter/flow/embedded_views.h"
18#include "flutter/flow/layer_snapshot_store.h"
19#include "flutter/flow/layers/layer_state_stack.h"
20#include "flutter/flow/raster_cache.h"
21#include "flutter/flow/stopwatch.h"
22#include "flutter/fml/build_config.h"
23#include "flutter/fml/compiler_specific.h"
24#include "flutter/fml/logging.h"
25#include "flutter/fml/macros.h"
26#include "flutter/fml/trace_event.h"
45class DisplayListLayer;
46class PerformanceOverlayLayer;
147 original_layer_id_ = old_layer->original_layer_id_;
154 return original_layer_id_ == old_layer->original_layer_id_;
180 bool save_layer_is_active =
true,
181 bool layer_itself_performs_readback =
false);
187 bool save_layer_is_active,
188 bool layer_itself_performs_readback);
191 bool save_layer_is_active_;
192 bool layer_itself_performs_readback_;
194 bool prev_surface_needs_readback_;
203 subtree_has_platform_view_ =
value;
233 if (subtree_has_platform_view_) {
271 uint64_t original_layer_id_;
272 bool subtree_has_platform_view_ =
false;
274 static uint64_t NextUniqueID();
276 FML_DISALLOW_COPY_AND_ASSIGN(
Layer);
void SetLayerPaintRegion(const Layer *layer, const PaintRegion ®ion)
PaintRegion GetOldLayerPaintRegion(const Layer *layer) const
Developer-facing API for rendering anything within the engine.
Collects snapshots of layers during frame rasterization.
bool painting_is_nop() const
static constexpr int kCallerCanApplyColorFilter
bool content_culled(const SkRect &content_bounds) const
static constexpr int kCallerCanApplyImageFilter
static constexpr int kCallerCanApplyOpacity
static AutoPrerollSaveLayerState Create(PrerollContext *preroll_context, bool save_layer_is_active=true, bool layer_itself_performs_readback=false)
~AutoPrerollSaveLayerState()
virtual void Diff(DiffContext *context, const Layer *old_layer)
virtual void Preroll(PrerollContext *context)=0
uint64_t original_layer_id() const
virtual RasterCacheKeyID caching_key_id() const
virtual void PreservePaintRegion(DiffContext *context)
const SkRect & paint_bounds() const
virtual const testing::MockLayer * as_mock_layer() const
static constexpr int kSaveLayerRenderFlags
void set_subtree_has_platform_view(bool value)
void AssignOldLayer(Layer *old_layer)
static constexpr int kRasterCacheRenderFlags
virtual void PaintChildren(PaintContext &context) const
virtual bool IsReplacing(DiffContext *context, const Layer *old_layer) const
virtual const PerformanceOverlayLayer * as_performance_overlay_layer() const
bool subtree_has_platform_view() const
bool needs_painting(PaintContext &context) const
virtual const DisplayListLayer * as_display_list_layer() const
virtual void Paint(PaintContext &context) const =0
virtual const ContainerLayer * as_container_layer() const
virtual const TextureLayer * as_texture_layer() const
uint64_t unique_id() const
void set_paint_bounds(const SkRect &paint_bounds)
#define FML_DCHECK(condition)
@ kAntiAliasWithSaveLayer
static constexpr SkRect kGiantRect
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
bool enable_leaf_layer_tracing
NOT_SLIMPELLER(const RasterCache *raster_cache)
ExternalViewEmbedder * view_embedder
impeller::AiksContext * aiks_context
bool rendering_above_platform_view
sk_sp< SkColorSpace > dst_color_space
const Stopwatch & raster_time
const Stopwatch & ui_time
LayerSnapshotStore * layer_snapshot_store
std::shared_ptr< TextureRegistry > texture_registry
GrDirectContext * gr_context
LayerStateStack & state_stack
GrDirectContext * gr_context
std::vector< RasterCacheItem * > * raster_cached_entries
std::shared_ptr< TextureRegistry > texture_registry
const Stopwatch & ui_time
const Stopwatch & raster_time
sk_sp< SkColorSpace > dst_color_space
NOT_SLIMPELLER(RasterCache *raster_cache)
LayerStateStack & state_stack
bool surface_needs_readback
int renderable_state_flags
ExternalViewEmbedder * view_embedder