| Index: tools/viewer/sk_app/Window.h
|
| diff --git a/tools/viewer/sk_app/Window.h b/tools/viewer/sk_app/Window.h
|
| index 63d5e19e5594716c9bc95742b0fac51fe8b9af75..65e1542e2cafe310c43e828193053da42804c17e 100644
|
| --- a/tools/viewer/sk_app/Window.h
|
| +++ b/tools/viewer/sk_app/Window.h
|
| @@ -27,7 +27,11 @@ public:
|
|
|
| virtual void setTitle(const char*) = 0;
|
| virtual void show() = 0;
|
| - virtual void inval() = 0;
|
| +
|
| + // Shedules an invalidation event for window if one is not currently pending.
|
| + // Make sure that either onPaint or markInvalReceived is called when the client window consumes
|
| + // the the inval event. They unset fIsContentInvalided which allow future onInval.
|
| + void inval();
|
|
|
| virtual bool scaleContentToFit() const { return false; }
|
| virtual bool supportsContentRect() const { return false; }
|
| @@ -164,6 +168,13 @@ protected:
|
| void* fPaintUserData;
|
|
|
| WindowContext* fWindowContext = nullptr;
|
| +
|
| + virtual void onInval() = 0;
|
| +
|
| + // Uncheck fIsContentInvalided to allow future inval/onInval.
|
| + void markInvalProcessed();
|
| +
|
| + bool fIsContentInvalidated = false; // use this to avoid duplicate invalidate events
|
| };
|
|
|
| } // namespace sk_app
|
|
|