2017-12-19 17:21:02 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkMatrix.h"
|
|
|
|
#include "include/core/SkTypes.h"
|
|
|
|
#include "include/private/SkTDArray.h"
|
2017-12-19 17:21:02 +00:00
|
|
|
|
|
|
|
struct SkRect;
|
|
|
|
|
|
|
|
namespace sksg {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Receiver for invalidation events.
|
|
|
|
*
|
|
|
|
* Tracks dirty regions for repaint.
|
|
|
|
*/
|
2018-07-16 21:44:06 +00:00
|
|
|
class InvalidationController {
|
2017-12-19 17:21:02 +00:00
|
|
|
public:
|
|
|
|
InvalidationController();
|
2018-07-16 21:44:06 +00:00
|
|
|
InvalidationController(const InvalidationController&) = delete;
|
|
|
|
InvalidationController& operator=(const InvalidationController&) = delete;
|
2017-12-19 17:21:02 +00:00
|
|
|
|
2017-12-29 00:24:07 +00:00
|
|
|
void inval(const SkRect&, const SkMatrix& ctm = SkMatrix::I());
|
2017-12-19 17:21:02 +00:00
|
|
|
|
2018-01-03 21:17:29 +00:00
|
|
|
const SkRect& bounds() const { return fBounds; }
|
|
|
|
const SkRect* begin() const { return fRects.begin(); }
|
|
|
|
const SkRect* end() const { return fRects.end(); }
|
2017-12-19 17:21:02 +00:00
|
|
|
|
2019-07-22 16:05:41 +00:00
|
|
|
void reset();
|
|
|
|
|
2017-12-19 17:21:02 +00:00
|
|
|
private:
|
|
|
|
SkTDArray<SkRect> fRects;
|
2018-01-03 21:17:29 +00:00
|
|
|
SkRect fBounds;
|
2017-12-19 17:21:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace sksg
|
|
|
|
|
|
|
|
#endif // SkSGInvalidationController_DEFINED
|