diff options
author | 2018-01-23 13:37:59 -0500 | |
---|---|---|
committer | 2018-01-23 18:59:20 +0000 | |
commit | 25366fad43043f1bfe02135f9c18515639a3c9b0 (patch) | |
tree | 0bf3b68c9fca7172d1f1fe9d88d0c781fae01700 /experimental/sksg | |
parent | 74d6e113a54da48be669645deacaa48235f77e53 (diff) |
[skottie] Initial mask support
TBR=
Change-Id: Ibf4baeb17f98e1ed359f04deefe2f1c09414540d
Reviewed-on: https://skia-review.googlesource.com/98840
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'experimental/sksg')
-rw-r--r-- | experimental/sksg/SkSGGroup.h | 3 | ||||
-rw-r--r-- | experimental/sksg/SkSGPaintNode.cpp | 1 | ||||
-rw-r--r-- | experimental/sksg/SkSGPaintNode.h | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/experimental/sksg/SkSGGroup.h b/experimental/sksg/SkSGGroup.h index f9126ea37f..482f10db8c 100644 --- a/experimental/sksg/SkSGGroup.h +++ b/experimental/sksg/SkSGGroup.h @@ -26,6 +26,9 @@ public: void addChild(sk_sp<RenderNode>); void removeChild(const sk_sp<RenderNode>&); + size_t size() const { return SkTo<size_t>(fChildren.count()); } + bool empty() const { return fChildren.empty(); } + protected: Group(); ~Group() override; diff --git a/experimental/sksg/SkSGPaintNode.cpp b/experimental/sksg/SkSGPaintNode.cpp index bb5b714030..9220b0f0af 100644 --- a/experimental/sksg/SkSGPaintNode.cpp +++ b/experimental/sksg/SkSGPaintNode.cpp @@ -23,6 +23,7 @@ SkRect PaintNode::onRevalidate(InvalidationController*, const SkMatrix&) { fPaint.reset(); fPaint.setAntiAlias(fAntiAlias); + fPaint.setBlendMode(fBlendMode); fPaint.setStyle(fStyle); fPaint.setStrokeWidth(fStrokeWidth); fPaint.setStrokeMiter(fStrokeMiter); diff --git a/experimental/sksg/SkSGPaintNode.h b/experimental/sksg/SkSGPaintNode.h index 1085e27c0f..5c9563b3a6 100644 --- a/experimental/sksg/SkSGPaintNode.h +++ b/experimental/sksg/SkSGPaintNode.h @@ -26,6 +26,7 @@ public: SG_ATTRIBUTE(AntiAlias , bool , fAntiAlias ) SG_ATTRIBUTE(Opacity , SkScalar , fOpacity ) + SG_ATTRIBUTE(BlendMode , SkBlendMode , fBlendMode ) SG_ATTRIBUTE(StrokeWidth, SkScalar , fStrokeWidth) SG_ATTRIBUTE(StrokeMiter, SkScalar , fStrokeMiter) SG_ATTRIBUTE(Style , SkPaint::Style, fStyle ) @@ -46,6 +47,7 @@ private: fStrokeWidth = 1, fStrokeMiter = 4; bool fAntiAlias = false; + SkBlendMode fBlendMode = SkBlendMode::kSrcOver; SkPaint::Style fStyle = SkPaint::kFill_Style; SkPaint::Join fStrokeJoin = SkPaint::kMiter_Join; SkPaint::Cap fStrokeCap = SkPaint::kButt_Cap; |