diff options
author | Mike Reed <reed@google.com> | 2017-06-28 19:57:21 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-29 12:14:53 +0000 |
commit | 44d04bd7ed3be8c39cc7ea02e3789cccf083bb55 (patch) | |
tree | 9fc3d15501a84bf9636b3ec5619b90c8d7f62a9a /include/core | |
parent | 7f22511c1cb4e823e17446c54aa308a2f2203899 (diff) |
add null-surface
Bug:crbug.com/737726
Change-Id: Iec9094d8d7232943e90fe2d9745fc83bcdf90954
Reviewed-on: https://skia-review.googlesource.com/21190
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkSurface.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h index 08e558cac7..f6142c9e3b 100644 --- a/include/core/SkSurface.h +++ b/include/core/SkSurface.h @@ -176,6 +176,12 @@ public: return MakeRenderTarget(gr, b, info, 0, kBottomLeft_GrSurfaceOrigin, nullptr); } + /** + * Returns a surface that stores no pixels. It can be drawn to via its canvas, but that + * canvas does not draw anything. Calling makeImageSnapshot() will return nullptr. + */ + static sk_sp<SkSurface> MakeNull(int width, int height); + int width() const { return fWidth; } int height() const { return fHeight; } |