Flutter Impeller
color_source_contents.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 
6 
9 
10 namespace impeller {
11 
13 
15 
17  opacity_ = alpha;
18 }
19 
21  return opacity_ * inherited_opacity_;
22 }
23 
25  inverse_matrix_ = matrix.Invert();
26 }
27 
29  return inverse_matrix_;
30 }
31 
33  return false;
34 }
35 
37  const Entity& entity) const {
38  const Geometry* geometry = GetGeometry();
39  return geometry ? geometry->GetCoverage(entity.GetTransform()) : std::nullopt;
40 }
41 
43  inherited_opacity_ = opacity;
44 }
45 
47  const Matrix& transform) const {
49 }
50 
51 } // namespace impeller
void SetInheritedOpacity(Scalar opacity) override
Inherit the provided opacity.
Scalar GetOpacityFactor() const
Get the opacity factor for this color source.
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
bool AppliesAlphaForStrokeCoverage(const Matrix &transform) const
Whether the entity should be treated as non-opaque due to stroke geometry requiring alpha for coverag...
void SetEffectTransform(Matrix matrix)
Set the effect transform for this color source.
const Matrix & GetInverseEffectTransform() const
Set the inverted effect transform for this color source.
virtual const Geometry * GetGeometry() const =0
Get the geometry that this contents will use to render.
void SetOpacityFactor(Scalar opacity)
Set the opacity factor for this color source.
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
Definition: entity.cc:46
virtual Scalar ComputeAlphaCoverage(const Matrix &transform) const
Definition: geometry.h:125
virtual std::optional< Rect > GetCoverage(const Matrix &transform) const =0
float Scalar
Definition: scalar.h:19
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
Matrix Invert() const
Definition: matrix.cc:99