2a2dfcbb42
Paint nodes contribute to invalidation. Hoist the inval logic from geometry nodes to draw nodes. TBR= Change-Id: Iab33086c377ef4940a84dae3cdccb2c9bdbee99c Reviewed-on: https://skia-review.googlesource.com/89901 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
27 lines
637 B
C++
27 lines
637 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 "SkSGGeometryNode.h"
|
|
|
|
namespace sksg {
|
|
|
|
GeometryNode::GeometryNode()
|
|
: fBounds(SkRect::MakeLTRB(SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax)) {}
|
|
|
|
void GeometryNode::draw(SkCanvas* canvas, const SkPaint& paint) const {
|
|
SkASSERT(!this->isInvalidated());
|
|
this->onDraw(canvas, paint);
|
|
}
|
|
|
|
void GeometryNode::onRevalidate(InvalidationController*, const SkMatrix&) {
|
|
SkASSERT(this->isInvalidated());
|
|
|
|
fBounds = this->onComputeBounds();
|
|
}
|
|
|
|
} // namespace sksg
|