[sksg] Fix setVisible() invalidation
Changes in visibility should generate damage. TBR= Change-Id: Ide7b660719b86bc9843d3dcfebeb6e39076879fb Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229279 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
e9ad99884e
commit
0ae324c528
@ -29,6 +29,11 @@ bool RenderNode::isVisible() const {
|
||||
}
|
||||
|
||||
void RenderNode::setVisible(bool v) {
|
||||
if (v == this->isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->invalidate();
|
||||
fNodeFlags = v ? (fNodeFlags & ~kInvisible_Flag)
|
||||
: (fNodeFlags | kInvisible_Flag);
|
||||
}
|
||||
|
@ -326,6 +326,15 @@ static void inval_test3(skiatest::Reporter* reporter) {
|
||||
&damage);
|
||||
}
|
||||
|
||||
{
|
||||
// Visibility change -> full inval.
|
||||
group->setVisible(false);
|
||||
std::vector<SkRect> damage = { { 50, 75, 350, 175} };
|
||||
check_inval(reporter, root,
|
||||
SkRect::MakeLTRB(50, 75, 350, 175),
|
||||
SkRect::MakeLTRB(50, 75, 350, 175),
|
||||
&damage);
|
||||
}
|
||||
}
|
||||
|
||||
static void inval_group_remove(skiatest::Reporter* reporter) {
|
||||
|
Loading…
Reference in New Issue
Block a user