#include <opacity_layer.h>
Definition at line 18 of file opacity_layer.h.
◆ OpacityLayer()
flutter::OpacityLayer::OpacityLayer |
( |
SkAlpha |
alpha, |
|
|
const SkPoint & |
offset |
|
) |
| |
Definition at line 15 of file opacity_layer.cc.
17 alpha_(alpha),
CacheableContainerLayer(int layer_cached_threshold=RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer, bool can_cache_children=false)
◆ children_can_accept_opacity()
bool flutter::OpacityLayer::children_can_accept_opacity |
( |
| ) |
const |
|
inline |
Definition at line 41 of file opacity_layer.h.
41 {
42 return children_can_accept_opacity_;
43 }
◆ Diff()
void flutter::OpacityLayer::Diff |
( |
DiffContext * |
context, |
|
|
const Layer * |
old_layer |
|
) |
| |
|
overridevirtual |
Reimplemented from flutter::ContainerLayer.
Definition at line 20 of file opacity_layer.cc.
20 {
21 DiffContext::AutoSubtreeRestore subtree(context);
23 if (!context->IsSubtreeDirty()) {
25 if (alpha_ !=
prev->alpha_ || offset_ !=
prev->offset_) {
26 context->MarkSubtreeDirty(context->GetOldLayerPaintRegion(old_layer));
27 }
28 }
30 if (context->has_raster_cache()) {
31 context->WillPaintWithIntegralTransform();
32 }
34 context->SetLayerPaintRegion(this, context->CurrentSubtreeRegion());
35}
static float prev(float f)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
virtual void DiffChildren(DiffContext *context, const ContainerLayer *old_layer)
OpacityLayer(SkAlpha alpha, const SkPoint &offset)
#define FML_DCHECK(condition)
◆ opacity()
SkScalar flutter::OpacityLayer::opacity |
( |
| ) |
const |
|
inline |
◆ Paint()
void flutter::OpacityLayer::Paint |
( |
PaintContext & |
context | ) |
const |
|
overridevirtual |
Reimplemented from flutter::ContainerLayer.
Definition at line 67 of file opacity_layer.cc.
67 {
69
70 auto mutator = context.state_stack.save();
71 mutator.translate(offset_.
fX, offset_.
fY);
72 if (context.raster_cache) {
73 mutator.integralTransform();
74 }
75
77
81 context.state_stack.fill(
paint))) {
82 return;
83 }
84 }
85
87}
std::unique_ptr< LayerRasterCacheItem > layer_raster_cache_item_
void PaintChildren(PaintContext &context) const override
const SkRect & child_paint_bounds() const
bool needs_painting(PaintContext &context) const
bool children_can_accept_opacity() const
◆ Preroll()
Reimplemented from flutter::ContainerLayer.
Definition at line 37 of file opacity_layer.cc.
37 {
38 auto mutator = context->state_stack.save();
39 mutator.translate(offset_);
41
43 context->state_stack.transform_3x3());
44 Layer::AutoPrerollSaveLayerState save =
46
48
51 0);
52
53
54
56
58
60
61
62
63 auto_cache.ShouldNotBeCached();
64 }
65}
void Preroll(PrerollContext *context) override
static constexpr int kCallerCanApplyOpacity
static AutoPrerollSaveLayerState Create(PrerollContext *preroll_context, bool save_layer_is_active=true, bool layer_itself_performs_readback=false)
const SkRect & paint_bounds() const
void set_paint_bounds(const SkRect &paint_bounds)
void set_children_can_accept_opacity(bool value)
static constexpr SkScalar toOpacity(uint8_t alpha)
◆ set_children_can_accept_opacity()
void flutter::OpacityLayer::set_children_can_accept_opacity |
( |
bool |
value | ) |
|
|
inline |
The documentation for this class was generated from the following files: