Chromium Code Reviews| 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..0ebaf2ef1e39873bbe1dc0e2d6e02e3a7d1aad9c 100644 |
| --- a/tools/viewer/sk_app/Window.h |
| +++ b/tools/viewer/sk_app/Window.h |
| @@ -27,7 +27,9 @@ public: |
| virtual void setTitle(const char*) = 0; |
| virtual void show() = 0; |
| - virtual void inval() = 0; |
| + |
| + // Check if the current window has any pending inval; call inval if not. |
|
djsollen
2016/05/23 17:06:48
update the comment...
// shedules an invalidation
|
| + void inval(); |
| virtual bool scaleContentToFit() const { return false; } |
| virtual bool supportsContentRect() const { return false; } |
| @@ -164,6 +166,16 @@ protected: |
| void* fPaintUserData; |
| WindowContext* fWindowContext = nullptr; |
| + |
| + // Make sure that either onPaint or markInvalReceived is called in the subclasses' |
|
djsollen
2016/05/23 17:06:48
I think this comment is outdated. the client wind
liyuqian
2016/05/23 17:29:51
In case that the client window doesn't call onPain
|
| + // implementations of inval. They unset fIsContentInvalided which allow invalIfNeeded |
| + // to invalidate the content in the future. |
| + 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 |