aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Base.h
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-05-29 15:41:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-29 20:42:17 +0000
commitf2c736400f03f8fe7fe356962c979f23df4d5f6b (patch)
tree809d21837d0701569cccd0e21f23e2ac5574007a /src/image/SkImage_Base.h
parent4f078f7cfac6580dce6e213c022708922739ac6d (diff)
support image-subsets in serialization
A follow-on API change *could* be to extend the SerialProcs to pass subset information up to the client, in case they want to handle the subsetting step themselves. Bug: skia:7983 Change-Id: I36d3f1ce439886384495485c3be3c591d611a135 Reviewed-on: https://skia-review.googlesource.com/130543 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/image/SkImage_Base.h')
-rw-r--r--src/image/SkImage_Base.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index 2049fb3561..0d54a39471 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -38,6 +38,10 @@ public:
virtual SkColorType onColorType() const = 0;
virtual SkAlphaType onAlphaType() const = 0;
+ virtual SkIRect onGetSubset() const {
+ return { 0, 0, this->width(), this->height() };
+ }
+
virtual bool onPeekPixels(SkPixmap*) const { return false; }
virtual const SkBitmap* onPeekBitmap() const { return nullptr; }