Flutter Engine
The Flutter Engine
|
#include "include/codec/SkAndroidCodec.h"
#include "include/codec/SkCodec.h"
#include "include/codec/SkEncodedImageFormat.h"
#include "include/codec/SkGifDecoder.h"
#include "include/codec/SkJpegDecoder.h"
#include "include/codec/SkPngChunkReader.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkColorType.h"
#include "include/core/SkData.h"
#include "include/core/SkDataTable.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageGenerator.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSize.h"
#include "include/core/SkStream.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/encode/SkJpegEncoder.h"
#include "include/encode/SkPngEncoder.h"
#include "include/encode/SkWebpEncoder.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkMalloc.h"
#include "include/private/base/SkTemplates.h"
#include "modules/skcms/skcms.h"
#include "src/base/SkAutoMalloc.h"
#include "src/base/SkRandom.h"
#include "src/codec/SkCodecImageGenerator.h"
#include "src/core/SkColorSpacePriv.h"
#include "src/core/SkMD5.h"
#include "src/core/SkStreamPriv.h"
#include "tests/FakeStreams.h"
#include "tests/Test.h"
#include "tools/DecodeUtils.h"
#include "tools/Resources.h"
#include "tools/ToolUtils.h"
#include <png.h>
#include <pngconf.h>
#include <setjmp.h>
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include <memory>
#include <utility>
#include <vector>
Go to the source code of this file.
Classes | |
class | LimitedPeekingMemStream |
class | LimitedRewindingStream |
Functions | |
static SkMD5::Digest | md5 (const SkBitmap &bm) |
static void | compare_to_good_digest (skiatest::Reporter *r, const SkMD5::Digest &goodDigest, const SkBitmap &bm) |
template<typename Codec > | |
static void | test_info (skiatest::Reporter *r, Codec *codec, const SkImageInfo &info, SkCodec::Result expectedResult, const SkMD5::Digest *goodDigest) |
SkIRect | generate_random_subset (SkRandom *rand, int w, int h) |
static void | test_incremental_decode (skiatest::Reporter *r, SkCodec *codec, const SkImageInfo &info, const SkMD5::Digest &goodDigest) |
static void | test_in_stripes (skiatest::Reporter *r, SkCodec *codec, const SkImageInfo &info, const SkMD5::Digest &goodDigest) |
template<typename Codec > | |
static void | test_codec (skiatest::Reporter *r, const char *path, Codec *codec, SkBitmap &bm, const SkImageInfo &info, const SkISize &size, SkCodec::Result expectedResult, SkMD5::Digest *digest, const SkMD5::Digest *goodDigest) |
static bool | supports_partial_scanlines (const char path[]) |
static void | check_scanline_decode (skiatest::Reporter *r, SkCodec *codec, SkMD5::Digest *codecDigest, const SkImageInfo &info, const char path[], SkISize size, bool supportsScanlineDecoding, bool supportsIncomplete, bool supportsNewScanlineDecoding) |
static void | check_subset_decode (skiatest::Reporter *r, SkCodec *codec, const SkImageInfo &info, SkISize size, bool supportsSubsetDecoding, bool supportsIncomplete) |
static void | check_android_codec (skiatest::Reporter *r, std::unique_ptr< SkCodec > codec, const SkMD5::Digest &codecDigest, const SkImageInfo &info, const char path[], SkISize size, bool supportsScanlineDecoding, bool supportsSubsetDecoding, bool supportsIncomplete, bool supportsNewScanlineDecoding) |
static void | check_codec_image_generator (skiatest::Reporter *r, const SkMD5::Digest &codecDigest, const SkImageInfo &info, const char path[], bool supportsIncomplete) |
static void | check (skiatest::Reporter *r, const char path[], SkISize size, bool supportsScanlineDecoding, bool supportsSubsetDecoding, bool supportsIncomplete, bool supportsNewScanlineDecoding=false) |
DEF_TEST (Codec_wbmp, r) | |
DEF_TEST (Codec_webp, r) | |
DEF_TEST (Codec_bmp, r) | |
DEF_TEST (Codec_ico, r) | |
DEF_TEST (Codec_gif, r) | |
DEF_TEST (Codec_jpg, r) | |
DEF_TEST (Codec_png, r) | |
static void | test_invalid_stream (skiatest::Reporter *r, const void *stream, size_t len) |
DEF_TEST (Codec_leaks, r) | |
DEF_TEST (Codec_null, r) | |
static void | test_dimensions (skiatest::Reporter *r, const char path[]) |
DEF_TEST (Codec_Dimensions, r) | |
static void | test_invalid (skiatest::Reporter *r, const char path[]) |
DEF_TEST (Codec_Empty, r) | |
DEF_TEST (Codec_webp_peek, r) | |
DEF_TEST (Codec_wbmp_restrictive, r) | |
DEF_TEST (Codec_wbmp_max_size, r) | |
DEF_TEST (Codec_jpeg_rewind, r) | |
static void | check_color_xform (skiatest::Reporter *r, const char *path) |
DEF_TEST (Codec_ColorXform, r) | |
static bool | color_type_match (SkColorType origColorType, SkColorType codecColorType) |
static bool | alpha_type_match (SkAlphaType origAlphaType, SkAlphaType codecAlphaType) |
static void | check_round_trip (skiatest::Reporter *r, SkCodec *origCodec, const SkImageInfo &info) |
DEF_TEST (Codec_PngRoundTrip, r) | |
static void | test_conversion_possible (skiatest::Reporter *r, const char *path, bool supportsScanlineDecoder, bool supportsIncrementalDecoder) |
DEF_TEST (Codec_F16ConversionPossible, r) | |
static void | decode_frame (skiatest::Reporter *r, SkCodec *codec, size_t frame) |
DEF_TEST (Codec_skipFullParse, r) | |
DEF_TEST (Codec_fallBack, r) | |
static void | seek_and_decode (const char *file, std::unique_ptr< SkStream > stream, skiatest::Reporter *r) |
DEF_TEST (Wuffs_seek_and_decode, r) | |
DEF_TEST (Codec_reusePng, r) | |
DEF_TEST (Codec_rowsDecoded, r) | |
static void | test_invalid_images (skiatest::Reporter *r, const char *path, SkCodec::Result expectedResult) |
DEF_TEST (Codec_InvalidImages, r) | |
static void | test_invalid_header (skiatest::Reporter *r, const char *path) |
DEF_TEST (Codec_InvalidHeader, r) | |
DEF_TEST (Codec_InvalidAnimated, r) | |
static void | encode_format (SkDynamicMemoryWStream *stream, const SkPixmap &pixmap, SkEncodedImageFormat format) |
static void | test_encode_icc (skiatest::Reporter *r, SkEncodedImageFormat format) |
DEF_TEST (Codec_EncodeICC, r) | |
DEF_TEST (Codec_webp_rowsDecoded, r) | |
DEF_TEST (Codec_ossfuzz6274, r) | |
DEF_TEST (Codec_78329453, r) | |
DEF_TEST (Codec_A8, r) | |
DEF_TEST (Codec_crbug807324, r) | |
DEF_TEST (Codec_F16_noColorSpace, r) | |
DEF_TEST (Codec_noConversion, r) | |
DEF_TEST (Codec_kBGR_101010x_XR_SkColorType_supported, r) | |
DEF_TEST (Codec_gif_notseekable, r) | |
DEF_TEST (Codec_gif_notseekable2, r) | |
DEF_TEST (Codec_gif_null_param, r) | |
DEF_TEST (Codec_gif_can_preserve_original_data, r) | |
DEF_TEST (Codec_jpeg_can_return_data_from_original_stream, r) | |
|
static |
Definition at line 1115 of file CodecTest.cpp.
|
static |
Definition at line 482 of file CodecTest.cpp.
|
static |
Definition at line 426 of file CodecTest.cpp.
|
static |
Definition at line 452 of file CodecTest.cpp.
|
static |
Definition at line 1076 of file CodecTest.cpp.
|
static |
Definition at line 1126 of file CodecTest.cpp.
|
static |
Definition at line 294 of file CodecTest.cpp.
|
static |
Definition at line 384 of file CodecTest.cpp.
|
static |
Definition at line 1104 of file CodecTest.cpp.
|
static |
Compute the digest for bm and compare it to a known good digest.
r | Reporter to assert that bm's digest matches goodDigest. |
goodDigest | The known good digest to compare to. |
bm | The bitmap to test. |
Definition at line 93 of file CodecTest.cpp.
|
static |
Definition at line 1250 of file CodecTest.cpp.
DEF_TEST | ( | Codec_78329453 | , |
r | |||
) |
Definition at line 1756 of file CodecTest.cpp.
DEF_TEST | ( | Codec_A8 | , |
r | |||
) |
Definition at line 1792 of file CodecTest.cpp.
DEF_TEST | ( | Codec_bmp | , |
r | |||
) |
Definition at line 539 of file CodecTest.cpp.
DEF_TEST | ( | Codec_ColorXform | , |
r | |||
) |
Definition at line 1099 of file CodecTest.cpp.
DEF_TEST | ( | Codec_crbug807324 | , |
r | |||
) |
Definition at line 1811 of file CodecTest.cpp.
DEF_TEST | ( | Codec_Dimensions | , |
r | |||
) |
Definition at line 673 of file CodecTest.cpp.
DEF_TEST | ( | Codec_Empty | , |
r | |||
) |
Definition at line 714 of file CodecTest.cpp.
DEF_TEST | ( | Codec_EncodeICC | , |
r | |||
) |
Definition at line 1692 of file CodecTest.cpp.
DEF_TEST | ( | Codec_F16_noColorSpace | , |
r | |||
) |
Definition at line 1846 of file CodecTest.cpp.
DEF_TEST | ( | Codec_F16ConversionPossible | , |
r | |||
) |
Definition at line 1244 of file CodecTest.cpp.
DEF_TEST | ( | Codec_fallBack | , |
r | |||
) |
Definition at line 1340 of file CodecTest.cpp.
DEF_TEST | ( | Codec_gif | , |
r | |||
) |
Definition at line 553 of file CodecTest.cpp.
DEF_TEST | ( | Codec_gif_can_preserve_original_data | , |
r | |||
) |
Definition at line 2021 of file CodecTest.cpp.
DEF_TEST | ( | Codec_gif_notseekable | , |
r | |||
) |
Definition at line 1921 of file CodecTest.cpp.
DEF_TEST | ( | Codec_gif_notseekable2 | , |
r | |||
) |
Definition at line 1954 of file CodecTest.cpp.
DEF_TEST | ( | Codec_gif_null_param | , |
r | |||
) |
Definition at line 1997 of file CodecTest.cpp.
DEF_TEST | ( | Codec_ico | , |
r | |||
) |
Definition at line 544 of file CodecTest.cpp.
DEF_TEST | ( | Codec_InvalidAnimated | , |
r | |||
) |
Definition at line 1603 of file CodecTest.cpp.
DEF_TEST | ( | Codec_InvalidHeader | , |
r | |||
) |
Definition at line 1528 of file CodecTest.cpp.
DEF_TEST | ( | Codec_InvalidImages | , |
r | |||
) |
Definition at line 1494 of file CodecTest.cpp.
DEF_TEST | ( | Codec_jpeg_can_return_data_from_original_stream | , |
r | |||
) |
Definition at line 2052 of file CodecTest.cpp.
DEF_TEST | ( | Codec_jpeg_rewind | , |
r | |||
) |
Definition at line 1026 of file CodecTest.cpp.
DEF_TEST | ( | Codec_jpg | , |
r | |||
) |
Definition at line 560 of file CodecTest.cpp.
DEF_TEST | ( | Codec_kBGR_101010x_XR_SkColorType_supported | , |
r | |||
) |
Definition at line 1903 of file CodecTest.cpp.
DEF_TEST | ( | Codec_leaks | , |
r | |||
) |
Definition at line 608 of file CodecTest.cpp.
DEF_TEST | ( | Codec_noConversion | , |
r | |||
) |
Definition at line 1862 of file CodecTest.cpp.
DEF_TEST | ( | Codec_null | , |
r | |||
) |
Definition at line 629 of file CodecTest.cpp.
DEF_TEST | ( | Codec_ossfuzz6274 | , |
r | |||
) |
Definition at line 1743 of file CodecTest.cpp.
DEF_TEST | ( | Codec_png | , |
r | |||
) |
Definition at line 570 of file CodecTest.cpp.
DEF_TEST | ( | Codec_PngRoundTrip | , |
r | |||
) |
Definition at line 1148 of file CodecTest.cpp.
DEF_TEST | ( | Codec_reusePng | , |
r | |||
) |
Definition at line 1424 of file CodecTest.cpp.
DEF_TEST | ( | Codec_rowsDecoded | , |
r | |||
) |
Definition at line 1452 of file CodecTest.cpp.
DEF_TEST | ( | Codec_skipFullParse | , |
r | |||
) |
Definition at line 1263 of file CodecTest.cpp.
DEF_TEST | ( | Codec_wbmp | , |
r | |||
) |
Definition at line 529 of file CodecTest.cpp.
DEF_TEST | ( | Codec_wbmp_max_size | , |
r | |||
) |
Definition at line 1002 of file CodecTest.cpp.
DEF_TEST | ( | Codec_wbmp_restrictive | , |
r | |||
) |
Definition at line 976 of file CodecTest.cpp.
DEF_TEST | ( | Codec_webp | , |
r | |||
) |
Definition at line 533 of file CodecTest.cpp.
DEF_TEST | ( | Codec_webp_peek | , |
r | |||
) |
Definition at line 950 of file CodecTest.cpp.
DEF_TEST | ( | Codec_webp_rowsDecoded | , |
r | |||
) |
Definition at line 1698 of file CodecTest.cpp.
DEF_TEST | ( | Wuffs_seek_and_decode | , |
r | |||
) |
Definition at line 1409 of file CodecTest.cpp.
|
static |
Definition at line 1639 of file CodecTest.cpp.
Definition at line 119 of file CodecTest.cpp.
|
static |
Definition at line 77 of file CodecTest.cpp.
|
static |
Definition at line 1383 of file CodecTest.cpp.
|
static |
Definition at line 280 of file CodecTest.cpp.
|
static |
Definition at line 187 of file CodecTest.cpp.
|
static |
Definition at line 1189 of file CodecTest.cpp.
|
static |
Definition at line 636 of file CodecTest.cpp.
|
static |
Definition at line 1657 of file CodecTest.cpp.
|
static |
Definition at line 145 of file CodecTest.cpp.
|
static |
Definition at line 131 of file CodecTest.cpp.
|
static |
Test decoding an SkCodec to a particular SkImageInfo.
Calling getPixels(info) should return expectedResult, and if goodDigest is non nullptr, the resulting decode should match.
Definition at line 106 of file CodecTest.cpp.
|
static |
Definition at line 704 of file CodecTest.cpp.
|
static |
Definition at line 1515 of file CodecTest.cpp.
|
static |
Definition at line 1480 of file CodecTest.cpp.
|
static |
Definition at line 598 of file CodecTest.cpp.