2017-12-19 17:21:02 +00:00
|
|
|
/*
|
|
|
|
* 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() {
|
2018-01-03 21:17:29 +00:00
|
|
|
SkASSERT(!this->hasInval());
|
2017-12-19 17:21:02 +00:00
|
|
|
|
|
|
|
return fPaint;
|
|
|
|
}
|
|
|
|
|
2018-01-03 21:17:29 +00:00
|
|
|
SkRect PaintNode::onRevalidate(InvalidationController*, const SkMatrix&) {
|
|
|
|
SkASSERT(this->hasInval());
|
2017-12-19 17:21:02 +00:00
|
|
|
|
2018-01-03 21:17:29 +00:00
|
|
|
if (this->hasSelfInval()) {
|
|
|
|
fPaint.reset();
|
|
|
|
fPaint.setAntiAlias(fAntiAlias);
|
|
|
|
fPaint.setStyle(fStyle);
|
|
|
|
fPaint.setStrokeWidth(fStrokeWidth);
|
|
|
|
fPaint.setStrokeMiter(fStrokeMiter);
|
|
|
|
fPaint.setStrokeJoin(fStrokeJoin);
|
|
|
|
fPaint.setStrokeCap(fStrokeCap);
|
2017-12-29 16:52:44 +00:00
|
|
|
|
2018-01-03 21:17:29 +00:00
|
|
|
this->onApplyToPaint(&fPaint);
|
|
|
|
}
|
|
|
|
|
|
|
|
return SkRect::MakeEmpty();
|
2017-12-19 17:21:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace sksg
|