skia2/experimental/sksg/SkSGInvalidationController.h
Florin Malita 2a2dfcbb42 [sksg] Fix paint inval
Paint nodes contribute to invalidation.  Hoist the inval logic from
geometry nodes to draw nodes.

TBR=
Change-Id: Iab33086c377ef4940a84dae3cdccb2c9bdbee99c
Reviewed-on: https://skia-review.googlesource.com/89901
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-12-29 00:41:00 +00:00

42 lines
844 B
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 "SkMatrix.h"
#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();
void inval(const SkRect&, const SkMatrix& ctm = SkMatrix::I());
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