blob: 4b133d871b5931a127e5cba05f779699b8df8e63 [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
Florin Malita80746c22017-12-30 12:39:11 -050020 if (!ctm.isIdentity()) {
21 ctm.mapRect(rect.writable());
Florin Malita2a2dfcb2017-12-28 19:24:07 -050022 }
23
24 fRects.push(*rect);
Florin Malita4aa44412017-12-19 12:21:02 -050025}
26
27} // namespace sksg