34template <
typename Pass>
71 if (!
paint->isSrcOver()) {
75 if (!isSaveLayer &&
paint->getImageFilter()) {
84 if (
paint->getColorFilter()) {
95 const uint32_t layerColor = layerPaint->
getColor();
141 while (
apply(&onlyDraws, record) ||
apply(&noDraws, record));
144#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
150 return !
paint->getShader() && !
paint->getColorFilter() && !
paint->getImageFilter() &&
163 if (
match->first<SaveLayer>()->backdrop) {
168 if (!
match->first<SaveLayer>()->filters.empty()) {
182 if (drawPaint ==
nullptr) {
196 record->
replace<NoOp>(saveLayerIndex);
197 record->
replace<NoOp>(saveLayerIndex+2);
203 apply(&pass, record);
221 if (
match->first<SaveLayer>()->backdrop) {
226 if (!
match->first<SaveLayer>()->filters.empty() ||
227 !
match->fourth<SaveLayer>()->filters.empty()) {
233 if (
nullptr == opacityPaint) {
241 if (filterLayerPaint ==
nullptr) {
256 record->
replace<NoOp>(saveLayerIndex);
257 record->
replace<NoOp>(saveLayerIndex + 6);
264 apply(&pass, record);
282#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
constexpr SkColor SK_ColorTRANSPARENT
static constexpr SkColor SkColorSetA(SkColor c, U8CPU a)
#define SkColorGetA(color)
constexpr SkAlpha SK_AlphaTRANSPARENT
static U8CPU SkMulDiv255Round(U16CPU a, U16CPU b)
static bool apply(Pass *pass, SkRecord *record)
static bool fold_opacity_layer_color_to_paint(const SkPaint *layerPaint, bool isSaveLayer, SkPaint *paint)
void SkRecordOptimize(SkRecord *record)
void SkRecordNoopSaveRestores(SkRecord *record)
void SkRecordMergeSvgOpacityAndFilterLayers(SkRecord *record)
void SkRecordNoopSaveLayerDrawRestores(SkRecord *record)
static bool effectively_srcover(const SkPaint *paint)
SkPathEffect * getPathEffect() const
SkColorFilter * getColorFilter() const
SkMaskFilter * getMaskFilter() const
SkImageFilter * getImageFilter() const
SkShader * getShader() const
static const char * begin(const StringSlice &s)
static ArrayPtr Match(const String &pat, const String &str)
bool onMatch(SkRecord *record, Match *match, int begin, int end)
static bool KillSaveLayerAndRestore(SkRecord *record, int saveLayerIndex)
Pattern< Is< SaveLayer >, IsSingleDraw, Is< Restore > > Match
bool onMatch(SkRecord *record, Match *, int begin, int end)
Pattern< Is< Save >, Greedy< Not< Or< Is< Save >, Is< SaveLayer >, Is< Restore >, IsDraw > > >, Is< Restore > > Match
bool onMatch(SkRecord *record, Match *, int begin, int end)
Pattern< Is< Save >, Greedy< Or< Is< NoOp >, IsDraw > >, Is< Restore > > Match
bool onMatch(SkRecord *record, Match *match, int begin, int end)
Pattern< Is< SaveLayer >, Is< Save >, Is< ClipRect >, Is< SaveLayer >, Is< Restore >, Is< Restore >, Is< Restore > > Match
static bool KillSaveLayerAndRestore(SkRecord *record, int saveLayerIndex)