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
|
|
|
|
|
2017-12-29 00:24:07 +00:00
|
|
|
#include "SkMatrix.h"
|
2017-12-19 17:21:02 +00:00
|
|
|
#include "SkTDArray.h"
|
|
|
|
#include "SkTypes.h"
|
|
|
|
|
|
|
|
struct SkRect;
|
|
|
|
|
|
|
|
namespace sksg {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Receiver for invalidation events.
|
|
|
|
*
|
|
|
|
* Tracks dirty regions for repaint.
|
|
|
|
*/
|
|
|
|
class InvalidationController : public SkNoncopyable {
|
|
|
|
public:
|
|
|
|
InvalidationController();
|
|
|
|
|
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
|
|
|
|
|
|
|
const SkRect* begin() const { return fRects.begin(); }
|
|
|
|
const SkRect* end() const { return fRects.end(); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkTDArray<SkRect> fRects;
|
|
|
|
|
|
|
|
typedef SkNoncopyable INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace sksg
|
|
|
|
|
|
|
|
#endif // SkSGInvalidationController_DEFINED
|