5#include "flutter/flow/layers/layer.h"
7#include "flutter/flow/paint_utils.h"
12 : paint_bounds_(
SkRect::MakeEmpty()),
13 unique_id_(NextUniqueID()),
14 original_layer_id_(unique_id_) {}
18uint64_t Layer::NextUniqueID() {
19 static std::atomic<uint64_t>
next_id(1);
27Layer::AutoPrerollSaveLayerState::AutoPrerollSaveLayerState(
28 PrerollContext* preroll_context,
29 bool save_layer_is_active,
30 bool layer_itself_performs_readback)
31 : preroll_context_(preroll_context),
32 save_layer_is_active_(save_layer_is_active),
33 layer_itself_performs_readback_(layer_itself_performs_readback) {
34 if (save_layer_is_active_) {
35 prev_surface_needs_readback_ = preroll_context_->surface_needs_readback;
36 preroll_context_->surface_needs_readback =
false;
42 bool save_layer_is_active,
43 bool layer_itself_performs_readback) {
45 layer_itself_performs_readback);
49 if (save_layer_is_active_) {
50 preroll_context_->surface_needs_readback =
51 (prev_surface_needs_readback_ || layer_itself_performs_readback_);
static uint32_t next_id()
static AutoPrerollSaveLayerState Create(PrerollContext *preroll_context, bool save_layer_is_active=true, bool layer_itself_performs_readback=false)
~AutoPrerollSaveLayerState()