#include <paint.h>
Classes | |
| struct | MaskBlurDescriptor |
Public Types | |
| enum | Style { Style::kFill, Style::kStroke } |
| using | ImageFilterProc = std::function< std::shared_ptr< FilterContents >(FilterInput::Ref, const Matrix &effect_transform, Entity::RenderingMode rendering_mode)> |
| using | MaskFilterProc = std::function< std::shared_ptr< FilterContents >(FilterInput::Ref, bool is_solid_color, const Matrix &effect_transform)> |
| using | ColorSourceProc = std::function< std::shared_ptr< ColorSourceContents >()> |
Public Member Functions | |
| std::shared_ptr< Contents > | WithFilters (std::shared_ptr< Contents > input) const |
| Wrap this paint's configured filters to the given contents. More... | |
| std::shared_ptr< Contents > | WithFiltersForSubpassTarget (std::shared_ptr< Contents > input, const Matrix &effect_transform=Matrix()) const |
| Wrap this paint's configured filters to the given contents of subpass target. More... | |
| bool | HasColorFilter () const |
| Whether this paint has a color filter that can apply opacity. More... | |
| std::shared_ptr< ColorSourceContents > | CreateContents () const |
| std::shared_ptr< Contents > | WithMaskBlur (std::shared_ptr< Contents > input, bool is_solid_color, const Matrix &ctm) const |
| std::shared_ptr< FilterContents > | WithImageFilter (const FilterInput::Variant &input, const Matrix &effect_transform, Entity::RenderingMode rendering_mode) const |
Static Public Member Functions | |
| static bool | CanApplyOpacityPeephole (const Paint &paint) |
| Whether or not a save layer with the provided paint can perform the opacity peephole optimization. More... | |
Public Attributes | |
| Color | color = Color::Black() |
| const flutter::DlColorSource * | color_source = nullptr |
| const flutter::DlColorFilter * | color_filter = nullptr |
| const flutter::DlImageFilter * | image_filter = nullptr |
| Scalar | stroke_width = 0.0 |
| Cap | stroke_cap = Cap::kButt |
| Join | stroke_join = Join::kMiter |
| Scalar | stroke_miter = 4.0 |
| Style | style = Style::kFill |
| BlendMode | blend_mode = BlendMode::kSourceOver |
| bool | invert_colors = false |
| std::optional< MaskBlurDescriptor > | mask_blur_descriptor |
| using impeller::Paint::ColorSourceProc = std::function<std::shared_ptr<ColorSourceContents>()> |
| using impeller::Paint::ImageFilterProc = std::function<std::shared_ptr<FilterContents>( FilterInput::Ref, const Matrix& effect_transform, Entity::RenderingMode rendering_mode)> |
| using impeller::Paint::MaskFilterProc = std::function<std::shared_ptr<FilterContents>( FilterInput::Ref, bool is_solid_color, const Matrix& effect_transform)> |
|
strong |
|
inlinestatic |
Whether or not a save layer with the provided paint can perform the opacity peephole optimization.
Definition at line 39 of file paint.h.
References blend_mode, color_filter, image_filter, invert_colors, impeller::kSourceOver, and mask_blur_descriptor.
Referenced by impeller::Canvas::SaveLayer().
| std::shared_ptr< ColorSourceContents > impeller::Paint::CreateContents | ( | ) | const |
Definition at line 37 of file paint.cc.
References impeller::Color::alpha, impeller::TSize< Scalar >::Ceil(), color, color_filter, color_source, impeller::skia_conversions::ConvertStops(), invert_colors, impeller::ColorFilterContents::kNo, impeller::FilterInput::Make(), impeller::TRect< Scalar >::MakePointBounds(), impeller::skia_conversions::ToMatrix(), impeller::skia_conversions::ToPoint(), impeller::skia_conversions::ToSamplerDescriptor(), impeller::WrapWithGPUColorFilter(), and impeller::WrapWithInvertColors().
| bool impeller::Paint::HasColorFilter | ( | ) | const |
Whether this paint has a color filter that can apply opacity.
Definition at line 447 of file paint.cc.
Referenced by impeller::Canvas::DrawImageRect().
Wrap this paint's configured filters to the given contents.
| [in] | input | The contents to wrap with paint's filters. |
Definition at line 256 of file paint.cc.
References image_filter, impeller::Entity::kDirect, impeller::ColorFilterContents::kYes, and WithImageFilter().
Referenced by impeller::Canvas::DrawAtlas(), impeller::Canvas::DrawImageRect(), impeller::Canvas::DrawTextFrame(), and impeller::Canvas::DrawVertices().
| std::shared_ptr< Contents > impeller::Paint::WithFiltersForSubpassTarget | ( | std::shared_ptr< Contents > | input, |
| const Matrix & | effect_transform = Matrix() |
||
| ) | const |
Wrap this paint's configured filters to the given contents of subpass target.
| [in] | input | The contents of subpass target to wrap with paint's filters. |
Definition at line 267 of file paint.cc.
References image_filter, impeller::Entity::kSubpassPrependSnapshotTransform, impeller::ColorFilterContents::kYes, and WithImageFilter().
| std::shared_ptr< FilterContents > impeller::Paint::WithImageFilter | ( | const FilterInput::Variant & | input, |
| const Matrix & | effect_transform, | ||
| Entity::RenderingMode | rendering_mode | ||
| ) | const |
Definition at line 290 of file paint.cc.
References image_filter, impeller::FilterInput::Make(), and impeller::WrapInput().
Referenced by impeller::Canvas::SaveLayer(), WithFilters(), and WithFiltersForSubpassTarget().
| std::shared_ptr< Contents > impeller::Paint::WithMaskBlur | ( | std::shared_ptr< Contents > | input, |
| bool | is_solid_color, | ||
| const Matrix & | ctm | ||
| ) | const |
Definition at line 280 of file paint.cc.
References impeller::FilterInput::Make(), and mask_blur_descriptor.
Referenced by impeller::Canvas::DrawTextFrame().
| BlendMode impeller::Paint::blend_mode = BlendMode::kSourceOver |
Definition at line 84 of file paint.h.
Referenced by CanApplyOpacityPeephole(), impeller::Canvas::DrawAtlas(), impeller::Canvas::DrawCircle(), impeller::DlDispatcherBase::drawColor(), impeller::Canvas::DrawImageRect(), impeller::Canvas::DrawLine(), impeller::Canvas::DrawOval(), impeller::Canvas::DrawPaint(), impeller::Canvas::DrawPath(), impeller::Canvas::DrawPoints(), impeller::Canvas::DrawRect(), impeller::Canvas::DrawRRect(), impeller::Canvas::DrawTextFrame(), impeller::Canvas::DrawVertices(), impeller::Canvas::Restore(), impeller::Canvas::SaveLayer(), and impeller::DlDispatcherBase::setBlendMode().
| Color impeller::Paint::color = Color::Black() |
Definition at line 74 of file paint.h.
Referenced by CreateContents(), impeller::Canvas::DrawAtlas(), impeller::DlDispatcherBase::drawColor(), impeller::DlDispatcherBase::drawDisplayList(), impeller::Canvas::DrawImageRect(), impeller::DlDispatcherBase::drawShadow(), impeller::Canvas::DrawTextFrame(), impeller::TextFrameDispatcher::drawTextFrame(), impeller::Canvas::DrawVertices(), impeller::Canvas::SaveLayer(), impeller::DlDispatcherBase::setColor(), and impeller::TextFrameDispatcher::setColor().
| const flutter::DlColorFilter* impeller::Paint::color_filter = nullptr |
Definition at line 76 of file paint.h.
Referenced by CanApplyOpacityPeephole(), CreateContents(), and impeller::DlDispatcherBase::setColorFilter().
| const flutter::DlColorSource* impeller::Paint::color_source = nullptr |
Definition at line 75 of file paint.h.
Referenced by CreateContents(), impeller::Canvas::DrawVertices(), and impeller::DlDispatcherBase::setColorSource().
| const flutter::DlImageFilter* impeller::Paint::image_filter = nullptr |
Definition at line 77 of file paint.h.
Referenced by CanApplyOpacityPeephole(), impeller::Canvas::SaveLayer(), impeller::DlDispatcherBase::setImageFilter(), WithFilters(), WithFiltersForSubpassTarget(), and WithImageFilter().
| bool impeller::Paint::invert_colors = false |
Definition at line 85 of file paint.h.
Referenced by CanApplyOpacityPeephole(), CreateContents(), and impeller::DlDispatcherBase::setInvertColors().
| std::optional<MaskBlurDescriptor> impeller::Paint::mask_blur_descriptor |
Definition at line 87 of file paint.h.
Referenced by CanApplyOpacityPeephole(), impeller::Canvas::DrawImageRect(), impeller::DlDispatcherBase::drawShadow(), impeller::Canvas::DrawTextFrame(), impeller::DlDispatcherBase::setMaskFilter(), and WithMaskBlur().
| Cap impeller::Paint::stroke_cap = Cap::kButt |
Definition at line 80 of file paint.h.
Referenced by impeller::Canvas::DrawLine(), impeller::Canvas::DrawPath(), impeller::DlDispatcherBase::drawPoints(), impeller::Canvas::DrawTextFrame(), impeller::TextFrameDispatcher::drawTextFrame(), impeller::DlDispatcherBase::setStrokeCap(), and impeller::TextFrameDispatcher::setStrokeCap().
| Join impeller::Paint::stroke_join = Join::kMiter |
Definition at line 81 of file paint.h.
Referenced by impeller::Canvas::DrawPath(), impeller::Canvas::DrawTextFrame(), impeller::TextFrameDispatcher::drawTextFrame(), impeller::DlDispatcherBase::setStrokeJoin(), and impeller::TextFrameDispatcher::setStrokeJoin().
| Scalar impeller::Paint::stroke_miter = 4.0 |
Definition at line 82 of file paint.h.
Referenced by impeller::Canvas::DrawPath(), impeller::Canvas::DrawTextFrame(), impeller::TextFrameDispatcher::drawTextFrame(), impeller::DlDispatcherBase::setStrokeMiter(), and impeller::TextFrameDispatcher::setStrokeMiter().
| Scalar impeller::Paint::stroke_width = 0.0 |
Definition at line 79 of file paint.h.
Referenced by impeller::Canvas::DrawCircle(), impeller::Canvas::DrawLine(), impeller::Canvas::DrawOval(), impeller::Canvas::DrawPath(), impeller::DlDispatcherBase::drawPoints(), impeller::Canvas::DrawTextFrame(), impeller::TextFrameDispatcher::drawTextFrame(), impeller::DlDispatcherBase::setStrokeWidth(), and impeller::TextFrameDispatcher::setStrokeWidth().
| Style impeller::Paint::style = Style::kFill |
Definition at line 83 of file paint.h.
Referenced by impeller::Canvas::DrawCircle(), impeller::DlDispatcherBase::drawDashedLine(), impeller::Canvas::DrawOval(), impeller::Canvas::DrawPath(), impeller::DlDispatcherBase::drawPoints(), impeller::Canvas::DrawRect(), impeller::Canvas::DrawRRect(), impeller::DlDispatcherBase::drawShadow(), impeller::Canvas::DrawTextFrame(), impeller::TextFrameDispatcher::drawTextFrame(), impeller::DlDispatcherBase::setDrawStyle(), and impeller::TextFrameDispatcher::setDrawStyle().