blob: df711abbf4fe2ded817c7e2a056a0e75805acec4 [file] [log] [blame]
/*
* 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 "SkSGInvalidationController.h"
#include "SkRect.h"
#include "SkTLazy.h"
namespace sksg {
InvalidationController::InvalidationController() : fBounds(SkRect::MakeEmpty()) {}
void InvalidationController::inval(const SkRect& r, const SkMatrix& ctm) {
if (r.isEmpty()) {
return;
}
SkTCopyOnFirstWrite<SkRect> rect(r);
if (!ctm.isIdentity()) {
ctm.mapRect(rect.writable());
}
fRects.push_back(*rect);
fBounds.join(*rect);
}
} // namespace sksg