skia2/resources
Leon Scroggins III 557fbbe05b Add animation support to SkWebpCodec
TBR=reed@google.com
(No change to the public API, but changed a header file)

SkWebpCodec:
- Implement onGetFrameCount, onGetFrameInfo, and onGetRepetitionCount
- Respect the alpha reported by libwebp. Although the spec states that
  it is only a hint, the libwebp encoder uses it properly. Respecting
  allows us to draw opaque images faster and decode them to 565. This
  also matches other SkCodecs (and Chromium).
- onGetPixels:
  - Decode the frame requested, recursively decoding required frame if
    necessary
  - When blending with a prior frame, use SkRasterPipeline

SkCodec:
- Move check for negative index to getFrameInfo
- Reset the colorXform if one is not needed

SkCodecAnimation:
- Add new blend enum, for WebP's (and APNG's) non-blending option

SkFrameHolder:
- New base classes for frames and the owner of the frames, allowing
  code sharing between SkWebpCodec and SkGifCodec (particularly for
  determining whether a frame has alpha and what frame it depends on)
- When moving items from SkGIFFrameContext, use Skia conventions (i.e.
  int instead of unsigned)
- Rename "delay time" to "duration", to match e.g. SkFrameInfo::
  fDuration

SkGifImageReader:
- Move pieces to SkFrameHolder, and adapt to changes made in the
  process
- Make setAlphaAndRequiredFrame (now on the base class SkFrameHolder)
  more general to support webp, and add support for frames that do not
  blend
- Change SkGIFFrameContext from a struct to a class, to match how we
  use the distinction elsewhere (i.e. struct is a small object with
  public fields)
- Rework hasTransparentPixel (now hasTransparency, since it returns true
  in some cases where there is not a transparent pixel) to better fit
  with the modified setAlphaAndRequiredFrame. Also be more consistent
  when there is no transparent pixel but no color map.
- Simplify an if condition that was previously simplified in 2d61e717
  but accidentally got reverted in a4db9be6

CodecAnimTest:
- Test new animated webp files
- Rearrange the test to more cleanly print alpha type mismatches for
  the first frame

resources:
- webp-animated.webp
  - animated webp from Chromium
- blendBG.webp
  - new webp file using bits of webp-animated-semitransparent4.webp
    from Chromium
  - tests required frame and alpha when using the non-blending mode
  - frames have the following properties:
    - Frame 0: no alpha, fills screen
    - Frame 1: alpha, fills screen
    - Frame 2: no alpha, fills screen
    - Frame 3: alpha, fills screen, blendBG
    - Frame 4: no alpha, fills screen, blendBG
    - Frame 5: alpha, blendBG
    - Frame 6: covers 4, has alpha, blendBG
  - also used to test decoding to 565 if the new frame data has alpha
    but blends onto an opaque frame

DM.cpp:
- Test animated images to non-native 8888 and unpremul

DMSrcSink.cpp:
- Do not test non-native 8888 decodes to f16 dst
- Test unpremul decodes to f16
- Copy a frame of an animated image prior to drawing, since in unpremul
  mode, the DM code will premultiply first.

Bug: skia: 3315
Change-Id: I4e55ae2ee5bc095b37a743bdcfac644be603b980
Reviewed-on: https://skia-review.googlesource.com/16707
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-05-23 15:28:37 +00:00
..
android_fonts Font variations. 2015-05-20 09:21:04 -07:00
empty_images Do not create an SkRawCodec with zero dimensions 2016-12-02 22:23:35 +00:00
fonts GM: add test for type1 font 2016-09-20 13:11:01 -07:00
icc_profiles Avoid interpolating color lut with less than 2 points 2017-05-05 15:18:03 +00:00
invalid_images SkPngCodec: Do not return kInvalidConversion on corrupt png 2017-04-26 17:43:38 +00:00
1x1.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
1x3.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
1x16.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
2x2.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
3x1.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
3x3.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
16x1.png Forgot to add resources with new test 2015-08-19 08:12:57 -07:00
alphabetAnim.gif Correct GIF frame dependencies and track alpha 2017-04-11 15:05:05 +00:00
arrow.png Bench baseline for mostly 0 image. 2013-09-25 21:42:12 +00:00
baby_tux.png Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
baby_tux.webp Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
blendBG.webp Add animation support to SkWebpCodec 2017-05-23 15:28:37 +00:00
box.gif Add a test for getFrameInfo on truncated data 2017-04-17 16:35:35 +00:00
brickwork_normal-map.jpg Add normal map sample 2015-07-09 09:04:16 -07:00
brickwork-texture.jpg Add normal map sample 2015-07-09 09:04:16 -07:00
CMYK.jpg Move resource dir from gm to trunk 2013-04-15 17:36:08 +00:00
color_wheel_with_profile.png Set SkColorSpace object for PNGs and parse ICC profiles 2016-03-04 13:27:35 -08:00
color_wheel.gif Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
color_wheel.ico SkCodec: add wbmp class 2015-03-27 12:16:53 -07:00
color_wheel.jpg Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
color_wheel.png Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
color_wheel.webp Replace color_wheel.* with beautiful versions I made with Skia. 2014-10-28 06:33:07 -07:00
colorTables.gif Report repetition count in SkCodec 2016-11-01 08:28:28 -07:00
cropped_mandrill.jpg Add getYUV8Planes() API to SkCodec 2016-01-22 14:46:42 -08:00
dng_with_preview.dng Optimize the SkRawStream when the input is an asset stream 2016-02-05 08:21:19 -08:00
exif-orientation-2-ur.jpg Parse icc profiles and exif orientation from jpeg markers 2016-03-21 08:04:40 -07:00
flutter_logo.jpg Add tool to create test images with interesting color profiles 2017-05-17 18:15:20 +00:00
gamut.png Add interesting features to visualize_color_gamut 2016-05-27 14:01:02 -07:00
google_chrome.ico Ico test with embedded png 2015-04-01 12:09:22 -07:00
grayscale.jpg Remove PDF JPEG shortcut, since it fails on grayscale JPEGs. 2014-12-02 06:37:21 -08:00
half-transparent-white-pixel.png Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
half-transparent-white-pixel.webp Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
icc-v2-gbr.jpg Parse icc profiles and exif orientation from jpeg markers 2016-03-21 08:04:40 -07:00
iconstrip.png Add png for difficult but common blit cases. 2016-05-11 11:12:17 -07:00
index8.png Scanline decoding for wbmp 2015-08-05 12:58:26 -07:00
mandrill_16.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_32.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_64.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_128.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_256.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_512_q075.jpg Add resources/mandrill_512_q075.jpg 2014-08-27 13:44:34 -04:00
mandrill_512.png More general GM for testing bitmap filtering, including checkerboards, images, and text. 2013-05-31 12:50:39 +00:00
mandrill_h1v1.jpg Add getYUV8Planes() API to SkCodec 2016-01-22 14:46:42 -08:00
mandrill_h2v1.jpg Add getYUV8Planes() API to SkCodec 2016-01-22 14:46:42 -08:00
mandrill.wbmp SkCodec: add wbmp class 2015-03-27 12:16:53 -07:00
nov-talk-sequence.txt demo tweaks, scale up perlin, add call to flush for fps 2015-11-09 13:10:30 -08:00
pdf_command_stream.txt SkPDF/Bench: add bench for SkPDFSharedStream (deflate) 2016-02-24 15:17:20 -08:00
plane_interlaced.png Merge SkCodec with SkScanlineDecoder 2015-09-30 08:57:14 -07:00
plane.png Move resource dir from gm to trunk 2013-04-15 17:36:08 +00:00
rainbow-gradient.png Add jpeg encoder alpha handling option 2017-05-09 18:32:04 +00:00
randPixels.bmp Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.gif Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.jpg Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.png Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixels.webp Flatten resources directory 2014-05-09 18:08:24 +00:00
randPixelsAnim2.gif Correct GIF frame dependencies and track alpha 2017-04-11 15:05:05 +00:00
randPixelsAnim.gif GIF: Better check for frame dependency 2017-01-03 19:07:41 +00:00
randPixelsOffset.gif Only attempt index8 if underlying GIF is index8 2016-12-16 19:51:52 +00:00
README BUG=skia:5602 2016-09-02 11:19:34 -07:00
rle.bmp Fix scanline decoding of rare RLE bmps 2016-02-11 08:41:01 -08:00
sample_1mp_rotated.dng Updates Piex and uses it to obtain the DNG dimensions. 2016-02-17 08:04:00 -08:00
sample_1mp.dng Add RAW decoding into Skia. 2016-01-25 08:26:16 -08:00
slides_content2.lua Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
slides_content.lua add code-style for slides 2014-11-02 19:19:34 -08:00
slides_transitions.lua update slides 2014-11-04 13:24:47 -08:00
slides_utils.lua update slides 2014-11-04 13:24:47 -08:00
slides.lua update slides 2014-11-04 13:24:47 -08:00
test640x479.gif Add a test for decoding a gif with sampleSize 4. 2015-05-14 14:44:14 -07:00
test.lua allow for lua click handlers 2014-10-11 11:28:07 -07:00
webp-animated.webp Add animation support to SkWebpCodec 2017-05-23 15:28:37 +00:00
webp-color-profile-crash.webp Parse ICC profiles from webps 2016-08-24 07:36:06 -07:00
webp-color-profile-lossless.webp Parse ICC profiles from webps 2016-08-24 07:36:06 -07:00
webp-color-profile-lossy-alpha.webp Parse ICC profiles from webps 2016-08-24 07:36:06 -07:00
webp-color-profile-lossy.webp Parse ICC profiles from webps 2016-08-24 07:36:06 -07:00
yellow_rose.png Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00
yellow_rose.webp Reland "Properly set alpha type in webp decode." 2014-04-24 18:55:13 +00:00

The resources directory includes some third party content used by Skia.
Licenses for that code are included in this file.

Openclipart

Openclipart uses the Creative Commons Zero 1.0 Public Domain License every time
an artist uploads a piece of clipart to Openclipart to make it clear the artist
is releasing the creative work for anyone to use for any reason, even
commercially. This act of "sharing" is the foundation Openclipart is based upon.
More details on the license can be found at
https://creativecommons.org/publicdomain/zero/1.0/.