Flutter Engine
backdrop_filter_layer.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/flow/layers/backdrop_filter_layer.h"
6 
7 namespace flutter {
8 
9 BackdropFilterLayer::BackdropFilterLayer(sk_sp<SkImageFilter> filter)
10  : filter_(std::move(filter)) {}
11 
13  const SkMatrix& matrix) {
15  Layer::AutoPrerollSaveLayerState::Create(context, true, bool(filter_));
16  ContainerLayer::Preroll(context, matrix);
17 }
18 
20  TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint");
22 
24  context,
25  SkCanvas::SaveLayerRec{&paint_bounds(), nullptr, filter_.get(), 0});
26  PaintChildren(context);
27 }
28 
29 } // namespace flutter
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:75
#define FML_DCHECK(condition)
Definition: logging.h:86
void Paint(PaintContext &context) const override
Definition: ref_ptr.h:252
void Preroll(PrerollContext *context, const SkMatrix &matrix) override
static AutoSaveLayer Create(const PaintContext &paint_context, const SkRect &bounds, const SkPaint *paint)
Definition: layer.cc:96
BackdropFilterLayer(sk_sp< SkImageFilter > filter)
bool needs_painting() const
Definition: layer.h:174
static AutoPrerollSaveLayerState Create(PrerollContext *preroll_context, bool save_layer_is_active=true, bool layer_itself_performs_readback=false)
Definition: layer.cc:43
const SkRect & paint_bounds() const
Definition: layer.h:166
void Preroll(PrerollContext *context, const SkMatrix &matrix) override
void PaintChildren(PaintContext &context) const