blob: 114d724d1ce1d3c08d87c9939295a7827a08074c [file] [log] [blame]
Florin Malita4aa44412017-12-19 12:21:02 -05001/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "SkSGInvalidationController.h"
9
10#include "SkRect.h"
Florin Malita2a2dfcb2017-12-28 19:24:07 -050011#include "SkTLazy.h"
Florin Malita4aa44412017-12-19 12:21:02 -050012
13namespace sksg {
14
15InvalidationController::InvalidationController() {}
16
Florin Malita2a2dfcb2017-12-28 19:24:07 -050017void InvalidationController::inval(const SkRect& r, const SkMatrix& ctm) {
18 SkTCopyOnFirstWrite<SkRect> rect(r);
19
20 if (!ctm.isIdentity() && !ctm.mapRect(rect.writable())) {
21 *rect.writable() = SkRect::MakeLTRB(SK_ScalarMin, SK_ScalarMin, SK_ScalarMax, SK_ScalarMax);
22 }
23
24 fRects.push(*rect);
Florin Malita4aa44412017-12-19 12:21:02 -050025}
26
27} // namespace sksg