skia2/experimental/sksg/SkSGPaintNode.cpp
Florin Malita fa8d49adfa [sksg] Refactor stroke logic
Instead of a specialized node, hoist attributes to base class.

TBR=
Change-Id: I4fa5a24dfc899307a8603577738972ebd32f57f5
Reviewed-on: https://skia-review.googlesource.com/89903
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-12-29 17:12:11 +00:00

35 lines
733 B
C++

/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkSGPaintNode.h"
namespace sksg {
PaintNode::PaintNode() {}
const SkPaint& PaintNode::makePaint() {
SkASSERT(!this->isInvalidated());
return fPaint;
}
void PaintNode::onRevalidate(InvalidationController*, const SkMatrix&) {
SkASSERT(this->isInvalidated());
fPaint.reset();
fPaint.setAntiAlias(fAntiAlias);
fPaint.setStyle(fStyle);
fPaint.setStrokeWidth(fStrokeWidth);
fPaint.setStrokeMiter(fStrokeMiter);
fPaint.setStrokeJoin(fStrokeJoin);
fPaint.setStrokeCap(fStrokeCap);
this->onApplyToPaint(&fPaint);
}
} // namespace sksg