skia2/modules/sksg/include/SkSGInvalidationController.h
Florin Malita b82c0ece7e [sksg] Clean up public headers
Change-Id: I0a6627f9b8d47e51c82c89ff1df75c3add8e8035
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267919
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-01-30 21:42:59 +00:00

48 lines
1.0 KiB
C++

/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkSGInvalidationController_DEFINED
#define SkSGInvalidationController_DEFINED
#include "include/core/SkMatrix.h"
#include "include/core/SkTypes.h"
#include <vector>
struct SkRect;
namespace sksg {
/**
* Receiver for invalidation events.
*
* Tracks dirty regions for repaint.
*/
class InvalidationController {
public:
InvalidationController();
InvalidationController(const InvalidationController&) = delete;
InvalidationController& operator=(const InvalidationController&) = delete;
void inval(const SkRect&, const SkMatrix& ctm = SkMatrix::I());
const SkRect& bounds() const { return fBounds; }
auto begin() const { return fRects.cbegin(); }
auto end() const { return fRects.cend(); }
void reset();
private:
std::vector<SkRect> fRects;
SkRect fBounds;
};
} // namespace sksg
#endif // SkSGInvalidationController_DEFINED