skia2/include
Leon Scroggins III 8a8a144952 Treat SkFILEStream's fOriginalOffset as the start
Bug: b/78866720

::rewind() rewinds to fOriginalOffset
::seek(position) seeks to position + fOriginalOffset
::move(offset) will not move < fOriginalOffset
::getPosition() returns position relative to fOriginalOffset
::getLength() returns full size minus fOriginalOffset
::duplicate() and ::fork() pass on fOriginalOffset

Android may create an SkFILEStream using a file descriptor whose offset
is at the beginning of the data that Android cares about. Treat all
positions in SkFILEStream as relative to that original offset.

This allows AnimatedImageDrawable to read directly from the
SkFILEStream, rather than using an SkFrontBufferedStream and forcing
SkGifCodec to cache data for later use.

This fixes a TODO that was introduced in
https://skia-review.googlesource.com/c/skia/+/9498 and takes it a step
further. In that CL, bungeman@ and I discussed the change and decided to
"leave this alone for now to avoid changing behavior". Doing a code
search today, the only two callers want the new behavior.

Change-Id: I9211394d5b730adf528fac0df0af7a664b1295be
Reviewed-on: https://skia-review.googlesource.com/126511
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-05-08 20:41:04 +00:00
..
android Simplify SkAnimatedImage 2018-01-30 18:46:35 +00:00
atlastext move SkIPoint16 to private header 2018-04-04 20:16:58 +00:00
c C API: document sk_matrix_t 2017-03-21 18:04:34 +00:00
codec Make SkAndroidCodec (optionally) respect origin 2018-01-26 22:13:34 +00:00
config Revert "Revert "SkUserConfig.h: remove out-of-date comment on SK_SFNTLY_SUBSETTER"" 2017-01-27 14:40:01 +00:00
core Treat SkFILEStream's fOriginalOffset as the start 2018-05-08 20:41:04 +00:00
effects [skottie] Add support for round-corners geometry effects 2018-05-01 14:54:14 +00:00
encode Revert "Add an Option for orientation on JPEG encodes" 2017-10-18 18:09:47 +00:00
gpu Implement canCopySurface for GrMock and GrMtl. 2018-05-03 20:13:02 +00:00
pathops Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
ports removed dead code behind legacy fontmgr api flag 2017-10-11 15:18:57 +00:00
private Add internal grsurface flag to track if using gl rectangle or external texture. 2018-05-02 21:34:58 +00:00
svg Add a SkWStream-based SkSVGCanvas factory 2017-09-19 20:33:19 +00:00
utils Take sk_sp<SkDevice> instead of SkDevice* 2018-05-02 14:46:17 +00:00
views [Viewer] Preserve gesture transformation matrix on slide/backend change 2018-01-05 18:18:39 +00:00