Florin Malita | 4aa4441 | 2017-12-19 12:21:02 -0500 | [diff] [blame] | 1 | /* |
| 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 Malita | 2a2dfcb | 2017-12-28 19:24:07 -0500 | [diff] [blame] | 11 | #include "SkTLazy.h" |
Florin Malita | 4aa4441 | 2017-12-19 12:21:02 -0500 | [diff] [blame] | 12 | |
| 13 | namespace sksg { |
| 14 | |
| 15 | InvalidationController::InvalidationController() {} |
| 16 | |
Florin Malita | 2a2dfcb | 2017-12-28 19:24:07 -0500 | [diff] [blame] | 17 | void 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 Malita | 4aa4441 | 2017-12-19 12:21:02 -0500 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | } // namespace sksg |