aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/sksg/SkSGInvalidationController.cpp
blob: 4b133d871b5931a127e5cba05f779699b8df8e63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * 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() {}

void InvalidationController::inval(const SkRect& r, const SkMatrix& ctm) {
    SkTCopyOnFirstWrite<SkRect> rect(r);

    if (!ctm.isIdentity()) {
        ctm.mapRect(rect.writable());
    }

    fRects.push(*rect);
}

} // namespace sksg