diff options
author | Mike Reed <reed@google.com> | 2017-03-10 10:49:45 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-10 16:29:32 +0000 |
commit | 566e53c7003920ff45c72498754060804b657c68 (patch) | |
tree | 01d1f0c6e65010b16f99b140eda9e724e4c8cae6 /include | |
parent | 8da9e940721168143d6296f578b6d7423de55d69 (diff) |
re-guard against negative dimensions on no-draw canvas
We used to (incidentally) guard for this when we used bitmapdevice as our backnig.
Now that we have a (faster) nodrawdevice, we need to explicitly guard for it.
BUG=skia:
Change-Id: I9cbbf064cbfced78f0004a2e5aff60aa3ded6215
Reviewed-on: https://skia-review.googlesource.com/9530
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkSize.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/core/SkSize.h b/include/core/SkSize.h index 2efcfb59dc..153335da68 100644 --- a/include/core/SkSize.h +++ b/include/core/SkSize.h @@ -21,6 +21,10 @@ template <typename T> struct SkTSize { return s; } + static SkTSize MakeEmpty() { + return {0, 0}; + } + void set(T w, T h) { fWidth = w; fHeight = h; |