/src/skia/src/codec/SkCodecPriv.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2015 The Android Open Source Project |
3 | | * |
4 | | * Use of this source code is governed by a BSD-style license that can be |
5 | | * found in the LICENSE file. |
6 | | */ |
7 | | |
8 | | #ifndef SkCodecPriv_DEFINED |
9 | | #define SkCodecPriv_DEFINED |
10 | | |
11 | | #include "include/codec/SkEncodedOrigin.h" |
12 | | #include "include/core/SkImageInfo.h" |
13 | | #include "include/core/SkTypes.h" |
14 | | #include "include/private/SkColorData.h" |
15 | | #include "include/private/SkEncodedInfo.h" |
16 | | #include "src/codec/SkColorTable.h" |
17 | | |
18 | | #ifdef SK_PRINT_CODEC_MESSAGES |
19 | | #define SkCodecPrintf SkDebugf |
20 | | #else |
21 | | #define SkCodecPrintf(...) |
22 | | #endif |
23 | | |
24 | | // Defined in SkCodec.cpp |
25 | | bool sk_select_xform_format(SkColorType colorType, bool forColorTable, |
26 | | skcms_PixelFormat* outFormat); |
27 | | |
28 | | // FIXME: Consider sharing with dm, nanbench, and tools. |
29 | 1.75k | static inline float get_scale_from_sample_size(int sampleSize) { |
30 | 1.75k | return 1.0f / ((float) sampleSize); |
31 | 1.75k | } Unexecuted instantiation: SkCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkMasks.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkSampler.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkWbmpCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkHeifCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkJpegCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkJpegUtility.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkIcoCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkPngCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkRawCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkWebpCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkWuffsCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkAndroidCodec.cpp:get_scale_from_sample_size(int) SkAndroidCodecAdapter.cpp:get_scale_from_sample_size(int) Line | Count | Source | 29 | 364 | static inline float get_scale_from_sample_size(int sampleSize) { | 30 | 364 | return 1.0f / ((float) sampleSize); | 31 | 364 | } |
Unexecuted instantiation: SkBmpCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkBmpRLECodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkBmpStandardCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkMaskSwizzler.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_scale_from_sample_size(int) SkSampledCodec.cpp:get_scale_from_sample_size(int) Line | Count | Source | 29 | 1.38k | static inline float get_scale_from_sample_size(int sampleSize) { | 30 | 1.38k | return 1.0f / ((float) sampleSize); | 31 | 1.38k | } |
Unexecuted instantiation: SkSwizzler.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkSVGDevice.cpp:get_scale_from_sample_size(int) Unexecuted instantiation: SkAnimatedImage.cpp:get_scale_from_sample_size(int) |
32 | | |
33 | 0 | static inline bool is_valid_subset(const SkIRect& subset, const SkISize& imageDims) { |
34 | 0 | return SkIRect::MakeSize(imageDims).contains(subset); |
35 | 0 | } Unexecuted instantiation: SkCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkMasks.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkSampler.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkWbmpCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkHeifCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkJpegCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkJpegDecoderMgr.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkJpegUtility.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkIcoCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkPngCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkRawCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkWebpCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkWuffsCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkAndroidCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkBmpCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkBmpMaskCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkBmpRLECodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkBmpStandardCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkMaskSwizzler.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkParseEncodedOrigin.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkSampledCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkSwizzler.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkBmpBaseCodec.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkSVGDevice.cpp:is_valid_subset(SkIRect const&, SkISize const&) Unexecuted instantiation: SkAnimatedImage.cpp:is_valid_subset(SkIRect const&, SkISize const&) |
36 | | |
37 | | /* |
38 | | * returns a scaled dimension based on the original dimension and the sampleSize |
39 | | * NOTE: we round down here for scaled dimension to match the behavior of SkImageDecoder |
40 | | * FIXME: I think we should call this get_sampled_dimension(). |
41 | | */ |
42 | 16.5k | static inline int get_scaled_dimension(int srcDimension, int sampleSize) { |
43 | 16.5k | if (sampleSize > srcDimension) { |
44 | 357 | return 1; |
45 | 357 | } |
46 | 16.1k | return srcDimension / sampleSize; |
47 | 16.1k | } Unexecuted instantiation: SkCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkMasks.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkSampler.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkWbmpCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkHeifCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkJpegCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkJpegUtility.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkIcoCodec.cpp:get_scaled_dimension(int, int) SkPngCodec.cpp:get_scaled_dimension(int, int) Line | Count | Source | 42 | 310 | static inline int get_scaled_dimension(int srcDimension, int sampleSize) { | 43 | 310 | if (sampleSize > srcDimension) { | 44 | 0 | return 1; | 45 | 0 | } | 46 | 310 | return srcDimension / sampleSize; | 47 | 310 | } |
Unexecuted instantiation: SkRawCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkWebpCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkWuffsCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkAndroidCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkBmpCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_scaled_dimension(int, int) SkBmpRLECodec.cpp:get_scaled_dimension(int, int) Line | Count | Source | 42 | 6.89k | static inline int get_scaled_dimension(int srcDimension, int sampleSize) { | 43 | 6.89k | if (sampleSize > srcDimension) { | 44 | 0 | return 1; | 45 | 0 | } | 46 | 6.89k | return srcDimension / sampleSize; | 47 | 6.89k | } |
SkBmpStandardCodec.cpp:get_scaled_dimension(int, int) Line | Count | Source | 42 | 5.79k | static inline int get_scaled_dimension(int srcDimension, int sampleSize) { | 43 | 5.79k | if (sampleSize > srcDimension) { | 44 | 0 | return 1; | 45 | 0 | } | 46 | 5.79k | return srcDimension / sampleSize; | 47 | 5.79k | } |
SkMaskSwizzler.cpp:get_scaled_dimension(int, int) Line | Count | Source | 42 | 8 | static inline int get_scaled_dimension(int srcDimension, int sampleSize) { | 43 | 8 | if (sampleSize > srcDimension) { | 44 | 0 | return 1; | 45 | 0 | } | 46 | 8 | return srcDimension / sampleSize; | 47 | 8 | } |
Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_scaled_dimension(int, int) SkSampledCodec.cpp:get_scaled_dimension(int, int) Line | Count | Source | 42 | 2.81k | static inline int get_scaled_dimension(int srcDimension, int sampleSize) { | 43 | 2.81k | if (sampleSize > srcDimension) { | 44 | 357 | return 1; | 45 | 357 | } | 46 | 2.45k | return srcDimension / sampleSize; | 47 | 2.45k | } |
SkSwizzler.cpp:get_scaled_dimension(int, int) Line | Count | Source | 42 | 698 | static inline int get_scaled_dimension(int srcDimension, int sampleSize) { | 43 | 698 | if (sampleSize > srcDimension) { | 44 | 0 | return 1; | 45 | 0 | } | 46 | 698 | return srcDimension / sampleSize; | 47 | 698 | } |
Unexecuted instantiation: SkBmpBaseCodec.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkSVGDevice.cpp:get_scaled_dimension(int, int) Unexecuted instantiation: SkAnimatedImage.cpp:get_scaled_dimension(int, int) |
48 | | |
49 | | /* |
50 | | * Returns the first coordinate that we will keep during a scaled decode. |
51 | | * The output can be interpreted as an x-coordinate or a y-coordinate. |
52 | | * |
53 | | * This does not need to be called and is not called when sampleFactor == 1. |
54 | | */ |
55 | 2.44M | static inline int get_start_coord(int sampleFactor) { return sampleFactor / 2; }; Unexecuted instantiation: SkCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkMasks.cpp:get_start_coord(int) Unexecuted instantiation: SkSampler.cpp:get_start_coord(int) Unexecuted instantiation: SkWbmpCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkHeifCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkJpegCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_start_coord(int) Unexecuted instantiation: SkJpegUtility.cpp:get_start_coord(int) Unexecuted instantiation: SkIcoCodec.cpp:get_start_coord(int) SkPngCodec.cpp:get_start_coord(int) Line | Count | Source | 55 | 57.3k | static inline int get_start_coord(int sampleFactor) { return sampleFactor / 2; }; |
Unexecuted instantiation: SkRawCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkWebpCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkWuffsCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkAndroidCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_start_coord(int) Unexecuted instantiation: SkBmpCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_start_coord(int) SkBmpRLECodec.cpp:get_start_coord(int) Line | Count | Source | 55 | 1.27M | static inline int get_start_coord(int sampleFactor) { return sampleFactor / 2; }; |
SkBmpStandardCodec.cpp:get_start_coord(int) Line | Count | Source | 55 | 5.79k | static inline int get_start_coord(int sampleFactor) { return sampleFactor / 2; }; |
SkMaskSwizzler.cpp:get_start_coord(int) Line | Count | Source | 55 | 8 | static inline int get_start_coord(int sampleFactor) { return sampleFactor / 2; }; |
Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_start_coord(int) SkSampledCodec.cpp:get_start_coord(int) Line | Count | Source | 55 | 1.10M | static inline int get_start_coord(int sampleFactor) { return sampleFactor / 2; }; |
SkSwizzler.cpp:get_start_coord(int) Line | Count | Source | 55 | 349 | static inline int get_start_coord(int sampleFactor) { return sampleFactor / 2; }; |
Unexecuted instantiation: SkBmpBaseCodec.cpp:get_start_coord(int) Unexecuted instantiation: SkSVGDevice.cpp:get_start_coord(int) Unexecuted instantiation: SkAnimatedImage.cpp:get_start_coord(int) |
56 | | |
57 | | /* |
58 | | * Given a coordinate in the original image, this returns the corresponding |
59 | | * coordinate in the scaled image. This function is meaningless if |
60 | | * IsCoordNecessary returns false. |
61 | | * The output can be interpreted as an x-coordinate or a y-coordinate. |
62 | | * |
63 | | * This does not need to be called and is not called when sampleFactor == 1. |
64 | | */ |
65 | 3.88M | static inline int get_dst_coord(int srcCoord, int sampleFactor) { return srcCoord / sampleFactor; }; Unexecuted instantiation: SkCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkMasks.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkSampler.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkWbmpCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkHeifCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkJpegCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkJpegUtility.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkIcoCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkPngCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkRawCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkWebpCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkWuffsCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkAndroidCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkBmpCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_dst_coord(int, int) SkBmpRLECodec.cpp:get_dst_coord(int, int) Line | Count | Source | 65 | 2.44M | static inline int get_dst_coord(int srcCoord, int sampleFactor) { return srcCoord / sampleFactor; }; |
Unexecuted instantiation: SkBmpStandardCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkMaskSwizzler.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_dst_coord(int, int) SkSampledCodec.cpp:get_dst_coord(int, int) Line | Count | Source | 65 | 1.43M | static inline int get_dst_coord(int srcCoord, int sampleFactor) { return srcCoord / sampleFactor; }; |
Unexecuted instantiation: SkSwizzler.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkSVGDevice.cpp:get_dst_coord(int, int) Unexecuted instantiation: SkAnimatedImage.cpp:get_dst_coord(int, int) |
66 | | |
67 | | /* |
68 | | * When scaling, we will discard certain y-coordinates (rows) and |
69 | | * x-coordinates (columns). This function returns true if we should keep the |
70 | | * coordinate and false otherwise. |
71 | | * The inputs may be x-coordinates or y-coordinates. |
72 | | * |
73 | | * This does not need to be called and is not called when sampleFactor == 1. |
74 | | */ |
75 | 2.38M | static inline bool is_coord_necessary(int srcCoord, int sampleFactor, int scaledDim) { |
76 | | // Get the first coordinate that we want to keep |
77 | 2.38M | int startCoord = get_start_coord(sampleFactor); |
78 | | |
79 | | // Return false on edge cases |
80 | 2.38M | if (srcCoord < startCoord || get_dst_coord(srcCoord, sampleFactor) >= scaledDim) { |
81 | 3.37k | return false; |
82 | 3.37k | } |
83 | | |
84 | | // Every sampleFactor rows are necessary |
85 | 2.37M | return ((srcCoord - startCoord) % sampleFactor) == 0; |
86 | 2.37M | } Unexecuted instantiation: SkCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkMasks.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkSampler.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkWbmpCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkHeifCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkJpegCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkJpegUtility.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkIcoCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkPngCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkRawCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkWebpCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkWuffsCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkAndroidCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkBmpCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkBmpMaskCodec.cpp:is_coord_necessary(int, int, int) SkBmpRLECodec.cpp:is_coord_necessary(int, int, int) Line | Count | Source | 75 | 1.27M | static inline bool is_coord_necessary(int srcCoord, int sampleFactor, int scaledDim) { | 76 | | // Get the first coordinate that we want to keep | 77 | 1.27M | int startCoord = get_start_coord(sampleFactor); | 78 | | | 79 | | // Return false on edge cases | 80 | 1.27M | if (srcCoord < startCoord || get_dst_coord(srcCoord, sampleFactor) >= scaledDim) { | 81 | 1.24k | return false; | 82 | 1.24k | } | 83 | | | 84 | | // Every sampleFactor rows are necessary | 85 | 1.27M | return ((srcCoord - startCoord) % sampleFactor) == 0; | 86 | 1.27M | } |
Unexecuted instantiation: SkBmpStandardCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkMaskSwizzler.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:is_coord_necessary(int, int, int) SkSampledCodec.cpp:is_coord_necessary(int, int, int) Line | Count | Source | 75 | 1.10M | static inline bool is_coord_necessary(int srcCoord, int sampleFactor, int scaledDim) { | 76 | | // Get the first coordinate that we want to keep | 77 | 1.10M | int startCoord = get_start_coord(sampleFactor); | 78 | | | 79 | | // Return false on edge cases | 80 | 1.10M | if (srcCoord < startCoord || get_dst_coord(srcCoord, sampleFactor) >= scaledDim) { | 81 | 2.12k | return false; | 82 | 2.12k | } | 83 | | | 84 | | // Every sampleFactor rows are necessary | 85 | 1.10M | return ((srcCoord - startCoord) % sampleFactor) == 0; | 86 | 1.10M | } |
Unexecuted instantiation: SkSwizzler.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkBmpBaseCodec.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkSVGDevice.cpp:is_coord_necessary(int, int, int) Unexecuted instantiation: SkAnimatedImage.cpp:is_coord_necessary(int, int, int) |
87 | | |
88 | 38.8k | static inline bool valid_alpha(SkAlphaType dstAlpha, bool srcIsOpaque) { |
89 | 38.8k | if (kUnknown_SkAlphaType == dstAlpha) { |
90 | 0 | return false; |
91 | 0 | } |
92 | | |
93 | 38.8k | if (srcIsOpaque) { |
94 | 5.68k | if (kOpaque_SkAlphaType != dstAlpha) { |
95 | 349 | SkCodecPrintf("Warning: an opaque image should be decoded as opaque " |
96 | 349 | "- it is being decoded as non-opaque, which will draw slower\n"); |
97 | 349 | } |
98 | 5.68k | return true; |
99 | 5.68k | } |
100 | | |
101 | 33.1k | return dstAlpha != kOpaque_SkAlphaType; |
102 | 33.1k | } SkCodec.cpp:valid_alpha(SkAlphaType, bool) Line | Count | Source | 88 | 38.7k | static inline bool valid_alpha(SkAlphaType dstAlpha, bool srcIsOpaque) { | 89 | 38.7k | if (kUnknown_SkAlphaType == dstAlpha) { | 90 | 0 | return false; | 91 | 0 | } | 92 | | | 93 | 38.7k | if (srcIsOpaque) { | 94 | 5.62k | if (kOpaque_SkAlphaType != dstAlpha) { | 95 | 341 | SkCodecPrintf("Warning: an opaque image should be decoded as opaque " | 96 | 341 | "- it is being decoded as non-opaque, which will draw slower\n"); | 97 | 341 | } | 98 | 5.62k | return true; | 99 | 5.62k | } | 100 | | | 101 | 33.1k | return dstAlpha != kOpaque_SkAlphaType; | 102 | 33.1k | } |
Unexecuted instantiation: SkMasks.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkSampler.cpp:valid_alpha(SkAlphaType, bool) SkWbmpCodec.cpp:valid_alpha(SkAlphaType, bool) Line | Count | Source | 88 | 62 | static inline bool valid_alpha(SkAlphaType dstAlpha, bool srcIsOpaque) { | 89 | 62 | if (kUnknown_SkAlphaType == dstAlpha) { | 90 | 0 | return false; | 91 | 0 | } | 92 | | | 93 | 62 | if (srcIsOpaque) { | 94 | 62 | if (kOpaque_SkAlphaType != dstAlpha) { | 95 | 8 | SkCodecPrintf("Warning: an opaque image should be decoded as opaque " | 96 | 8 | "- it is being decoded as non-opaque, which will draw slower\n"); | 97 | 8 | } | 98 | 62 | return true; | 99 | 62 | } | 100 | | | 101 | 0 | return dstAlpha != kOpaque_SkAlphaType; | 102 | 0 | } |
Unexecuted instantiation: SkHeifCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkJpegCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkJpegDecoderMgr.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkJpegUtility.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkIcoCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkPngCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkRawCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkWebpCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkWuffsCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkAndroidCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkBmpCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkBmpMaskCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkBmpRLECodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkBmpStandardCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkMaskSwizzler.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkParseEncodedOrigin.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkSampledCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkSwizzler.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkBmpBaseCodec.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkSVGDevice.cpp:valid_alpha(SkAlphaType, bool) Unexecuted instantiation: SkAnimatedImage.cpp:valid_alpha(SkAlphaType, bool) |
103 | | |
104 | | /* |
105 | | * If there is a color table, get a pointer to the colors, otherwise return nullptr |
106 | | */ |
107 | 3.70k | static inline const SkPMColor* get_color_ptr(SkColorTable* colorTable) { |
108 | 3.05k | return nullptr != colorTable ? colorTable->readColors() : nullptr; |
109 | 3.70k | } Unexecuted instantiation: SkCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkMasks.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkSampler.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkWbmpCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkHeifCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkJpegCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkJpegUtility.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkIcoCodec.cpp:get_color_ptr(SkColorTable*) SkPngCodec.cpp:get_color_ptr(SkColorTable*) Line | Count | Source | 107 | 3.33k | static inline const SkPMColor* get_color_ptr(SkColorTable* colorTable) { | 108 | 2.89k | return nullptr != colorTable ? colorTable->readColors() : nullptr; | 109 | 3.33k | } |
Unexecuted instantiation: SkRawCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkWebpCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkWuffsCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkAndroidCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkBmpCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkBmpRLECodec.cpp:get_color_ptr(SkColorTable*) SkBmpStandardCodec.cpp:get_color_ptr(SkColorTable*) Line | Count | Source | 107 | 372 | static inline const SkPMColor* get_color_ptr(SkColorTable* colorTable) { | 108 | 219 | return nullptr != colorTable ? colorTable->readColors() : nullptr; | 109 | 372 | } |
Unexecuted instantiation: SkMaskSwizzler.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkSampledCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkSwizzler.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkSVGDevice.cpp:get_color_ptr(SkColorTable*) Unexecuted instantiation: SkAnimatedImage.cpp:get_color_ptr(SkColorTable*) |
110 | | |
111 | | /* |
112 | | * Compute row bytes for an image using pixels per byte |
113 | | */ |
114 | 3.52k | static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { |
115 | 3.52k | return (width + pixelsPerByte - 1) / pixelsPerByte; |
116 | 3.52k | } Unexecuted instantiation: SkCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkMasks.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkSampler.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkIcoCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkPngCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkRawCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:compute_row_bytes_ppb(int, unsigned int) SkBmpCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Line | Count | Source | 114 | 615 | static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { | 115 | 615 | return (width + pixelsPerByte - 1) / pixelsPerByte; | 116 | 615 | } |
Unexecuted instantiation: SkBmpMaskCodec.cpp:compute_row_bytes_ppb(int, unsigned int) SkBmpRLECodec.cpp:compute_row_bytes_ppb(int, unsigned int) Line | Count | Source | 114 | 2.44k | static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { | 115 | 2.44k | return (width + pixelsPerByte - 1) / pixelsPerByte; | 116 | 2.44k | } |
SkBmpStandardCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Line | Count | Source | 114 | 466 | static inline size_t compute_row_bytes_ppb(int width, uint32_t pixelsPerByte) { | 115 | 466 | return (width + pixelsPerByte - 1) / pixelsPerByte; | 116 | 466 | } |
Unexecuted instantiation: SkMaskSwizzler.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkSwizzler.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkBmpBaseCodec.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:compute_row_bytes_ppb(int, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:compute_row_bytes_ppb(int, unsigned int) |
117 | | |
118 | | /* |
119 | | * Compute row bytes for an image using bytes per pixel |
120 | | */ |
121 | 1.27k | static inline size_t compute_row_bytes_bpp(int width, uint32_t bytesPerPixel) { |
122 | 1.27k | return width * bytesPerPixel; |
123 | 1.27k | } Unexecuted instantiation: SkCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkMasks.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkSampler.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkIcoCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkPngCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkRawCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:compute_row_bytes_bpp(int, unsigned int) SkBmpCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Line | Count | Source | 121 | 548 | static inline size_t compute_row_bytes_bpp(int width, uint32_t bytesPerPixel) { | 122 | 548 | return width * bytesPerPixel; | 123 | 548 | } |
Unexecuted instantiation: SkBmpMaskCodec.cpp:compute_row_bytes_bpp(int, unsigned int) SkBmpRLECodec.cpp:compute_row_bytes_bpp(int, unsigned int) Line | Count | Source | 121 | 731 | static inline size_t compute_row_bytes_bpp(int width, uint32_t bytesPerPixel) { | 122 | 731 | return width * bytesPerPixel; | 123 | 731 | } |
Unexecuted instantiation: SkBmpStandardCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkMaskSwizzler.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkSwizzler.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkBmpBaseCodec.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:compute_row_bytes_bpp(int, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:compute_row_bytes_bpp(int, unsigned int) |
124 | | |
125 | | /* |
126 | | * Compute row bytes for an image |
127 | | */ |
128 | 4.80k | static inline size_t compute_row_bytes(int width, uint32_t bitsPerPixel) { |
129 | 4.80k | if (bitsPerPixel < 16) { |
130 | 3.52k | SkASSERT(0 == 8 % bitsPerPixel); |
131 | 3.52k | const uint32_t pixelsPerByte = 8 / bitsPerPixel; |
132 | 3.52k | return compute_row_bytes_ppb(width, pixelsPerByte); |
133 | 1.27k | } else { |
134 | 1.27k | SkASSERT(0 == bitsPerPixel % 8); |
135 | 1.27k | const uint32_t bytesPerPixel = bitsPerPixel / 8; |
136 | 1.27k | return compute_row_bytes_bpp(width, bytesPerPixel); |
137 | 1.27k | } |
138 | 4.80k | } Unexecuted instantiation: SkCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkMasks.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkSampler.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkIcoCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkPngCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkRawCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:compute_row_bytes(int, unsigned int) SkBmpCodec.cpp:compute_row_bytes(int, unsigned int) Line | Count | Source | 128 | 1.16k | static inline size_t compute_row_bytes(int width, uint32_t bitsPerPixel) { | 129 | 1.16k | if (bitsPerPixel < 16) { | 130 | 615 | SkASSERT(0 == 8 % bitsPerPixel); | 131 | 615 | const uint32_t pixelsPerByte = 8 / bitsPerPixel; | 132 | 615 | return compute_row_bytes_ppb(width, pixelsPerByte); | 133 | 548 | } else { | 134 | 548 | SkASSERT(0 == bitsPerPixel % 8); | 135 | 548 | const uint32_t bytesPerPixel = bitsPerPixel / 8; | 136 | 548 | return compute_row_bytes_bpp(width, bytesPerPixel); | 137 | 548 | } | 138 | 1.16k | } |
Unexecuted instantiation: SkBmpMaskCodec.cpp:compute_row_bytes(int, unsigned int) SkBmpRLECodec.cpp:compute_row_bytes(int, unsigned int) Line | Count | Source | 128 | 3.17k | static inline size_t compute_row_bytes(int width, uint32_t bitsPerPixel) { | 129 | 3.17k | if (bitsPerPixel < 16) { | 130 | 2.44k | SkASSERT(0 == 8 % bitsPerPixel); | 131 | 2.44k | const uint32_t pixelsPerByte = 8 / bitsPerPixel; | 132 | 2.44k | return compute_row_bytes_ppb(width, pixelsPerByte); | 133 | 731 | } else { | 134 | 731 | SkASSERT(0 == bitsPerPixel % 8); | 135 | 731 | const uint32_t bytesPerPixel = bitsPerPixel / 8; | 136 | 731 | return compute_row_bytes_bpp(width, bytesPerPixel); | 137 | 731 | } | 138 | 3.17k | } |
SkBmpStandardCodec.cpp:compute_row_bytes(int, unsigned int) Line | Count | Source | 128 | 466 | static inline size_t compute_row_bytes(int width, uint32_t bitsPerPixel) { | 129 | 466 | if (bitsPerPixel < 16) { | 130 | 466 | SkASSERT(0 == 8 % bitsPerPixel); | 131 | 466 | const uint32_t pixelsPerByte = 8 / bitsPerPixel; | 132 | 466 | return compute_row_bytes_ppb(width, pixelsPerByte); | 133 | 0 | } else { | 134 | 0 | SkASSERT(0 == bitsPerPixel % 8); | 135 | 0 | const uint32_t bytesPerPixel = bitsPerPixel / 8; | 136 | 0 | return compute_row_bytes_bpp(width, bytesPerPixel); | 137 | 0 | } | 138 | 466 | } |
Unexecuted instantiation: SkMaskSwizzler.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkSwizzler.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkBmpBaseCodec.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:compute_row_bytes(int, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:compute_row_bytes(int, unsigned int) |
139 | | |
140 | | /* |
141 | | * Get a byte from a buffer |
142 | | * This method is unsafe, the caller is responsible for performing a check |
143 | | */ |
144 | 13.4k | static inline uint8_t get_byte(const uint8_t* buffer, uint32_t i) { |
145 | 13.4k | return buffer[i]; |
146 | 13.4k | } Unexecuted instantiation: SkCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkMasks.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkSampler.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkIcoCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkPngCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkRawCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_byte(unsigned char const*, unsigned int) SkBmpRLECodec.cpp:get_byte(unsigned char const*, unsigned int) Line | Count | Source | 144 | 6.57k | static inline uint8_t get_byte(const uint8_t* buffer, uint32_t i) { | 145 | 6.57k | return buffer[i]; | 146 | 6.57k | } |
SkBmpStandardCodec.cpp:get_byte(unsigned char const*, unsigned int) Line | Count | Source | 144 | 6.90k | static inline uint8_t get_byte(const uint8_t* buffer, uint32_t i) { | 145 | 6.90k | return buffer[i]; | 146 | 6.90k | } |
Unexecuted instantiation: SkMaskSwizzler.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkSwizzler.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:get_byte(unsigned char const*, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:get_byte(unsigned char const*, unsigned int) |
147 | | |
148 | | /* |
149 | | * Get a short from a buffer |
150 | | * This method is unsafe, the caller is responsible for performing a check |
151 | | */ |
152 | 7.36k | static inline uint16_t get_short(const uint8_t* buffer, uint32_t i) { |
153 | 7.36k | uint16_t result; |
154 | 7.36k | memcpy(&result, &(buffer[i]), 2); |
155 | | #ifdef SK_CPU_BENDIAN |
156 | | return SkEndianSwap16(result); |
157 | | #else |
158 | 7.36k | return result; |
159 | 7.36k | #endif |
160 | 7.36k | } Unexecuted instantiation: SkCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkMasks.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkSampler.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:get_short(unsigned char const*, unsigned int) SkIcoCodec.cpp:get_short(unsigned char const*, unsigned int) Line | Count | Source | 152 | 3.45k | static inline uint16_t get_short(const uint8_t* buffer, uint32_t i) { | 153 | 3.45k | uint16_t result; | 154 | 3.45k | memcpy(&result, &(buffer[i]), 2); | 155 | | #ifdef SK_CPU_BENDIAN | 156 | | return SkEndianSwap16(result); | 157 | | #else | 158 | 3.45k | return result; | 159 | 3.45k | #endif | 160 | 3.45k | } |
Unexecuted instantiation: SkPngCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkRawCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_short(unsigned char const*, unsigned int) SkBmpCodec.cpp:get_short(unsigned char const*, unsigned int) Line | Count | Source | 152 | 3.91k | static inline uint16_t get_short(const uint8_t* buffer, uint32_t i) { | 153 | 3.91k | uint16_t result; | 154 | 3.91k | memcpy(&result, &(buffer[i]), 2); | 155 | | #ifdef SK_CPU_BENDIAN | 156 | | return SkEndianSwap16(result); | 157 | | #else | 158 | 3.91k | return result; | 159 | 3.91k | #endif | 160 | 3.91k | } |
Unexecuted instantiation: SkBmpMaskCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpRLECodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpStandardCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkMaskSwizzler.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkSwizzler.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:get_short(unsigned char const*, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:get_short(unsigned char const*, unsigned int) |
161 | | |
162 | | /* |
163 | | * Get an int from a buffer |
164 | | * This method is unsafe, the caller is responsible for performing a check |
165 | | */ |
166 | 272k | static inline uint32_t get_int(const uint8_t* buffer, uint32_t i) { |
167 | 272k | uint32_t result; |
168 | 272k | memcpy(&result, &(buffer[i]), 4); |
169 | | #ifdef SK_CPU_BENDIAN |
170 | | return SkEndianSwap32(result); |
171 | | #else |
172 | 272k | return result; |
173 | 272k | #endif |
174 | 272k | } Unexecuted instantiation: SkCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkMasks.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkSampler.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:get_int(unsigned char const*, unsigned int) SkIcoCodec.cpp:get_int(unsigned char const*, unsigned int) Line | Count | Source | 166 | 257k | static inline uint32_t get_int(const uint8_t* buffer, uint32_t i) { | 167 | 257k | uint32_t result; | 168 | 257k | memcpy(&result, &(buffer[i]), 4); | 169 | | #ifdef SK_CPU_BENDIAN | 170 | | return SkEndianSwap32(result); | 171 | | #else | 172 | 257k | return result; | 173 | 257k | #endif | 174 | 257k | } |
Unexecuted instantiation: SkPngCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkRawCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_int(unsigned char const*, unsigned int) SkBmpCodec.cpp:get_int(unsigned char const*, unsigned int) Line | Count | Source | 166 | 14.9k | static inline uint32_t get_int(const uint8_t* buffer, uint32_t i) { | 167 | 14.9k | uint32_t result; | 168 | 14.9k | memcpy(&result, &(buffer[i]), 4); | 169 | | #ifdef SK_CPU_BENDIAN | 170 | | return SkEndianSwap32(result); | 171 | | #else | 172 | 14.9k | return result; | 173 | 14.9k | #endif | 174 | 14.9k | } |
Unexecuted instantiation: SkBmpMaskCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpRLECodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpStandardCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkMaskSwizzler.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkSwizzler.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:get_int(unsigned char const*, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:get_int(unsigned char const*, unsigned int) |
175 | | |
176 | | /* |
177 | | * @param data Buffer to read bytes from |
178 | | * @param isLittleEndian Output parameter |
179 | | * Indicates if the data is little endian |
180 | | * Is unaffected on false returns |
181 | | */ |
182 | 17.1k | static inline bool is_valid_endian_marker(const uint8_t* data, bool* isLittleEndian) { |
183 | | // II indicates Intel (little endian) and MM indicates motorola (big endian). |
184 | 17.1k | if (('I' != data[0] || 'I' != data[1]) && ('M' != data[0] || 'M' != data[1])) { |
185 | 4.92k | return false; |
186 | 4.92k | } |
187 | | |
188 | 12.2k | *isLittleEndian = ('I' == data[0]); |
189 | 12.2k | return true; |
190 | 12.2k | } Unexecuted instantiation: SkCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkMasks.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkSampler.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkWbmpCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkHeifCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkJpegCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkJpegDecoderMgr.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkJpegUtility.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkIcoCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkPngCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) SkRawCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Line | Count | Source | 182 | 8.50k | static inline bool is_valid_endian_marker(const uint8_t* data, bool* isLittleEndian) { | 183 | | // II indicates Intel (little endian) and MM indicates motorola (big endian). | 184 | 8.50k | if (('I' != data[0] || 'I' != data[1]) && ('M' != data[0] || 'M' != data[1])) { | 185 | 968 | return false; | 186 | 968 | } | 187 | | | 188 | 7.53k | *isLittleEndian = ('I' == data[0]); | 189 | 7.53k | return true; | 190 | 7.53k | } |
Unexecuted instantiation: SkWebpCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkWuffsCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkAndroidCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkBmpCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkBmpMaskCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkBmpRLECodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkBmpStandardCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkMaskSwizzler.cpp:is_valid_endian_marker(unsigned char const*, bool*) SkParseEncodedOrigin.cpp:is_valid_endian_marker(unsigned char const*, bool*) Line | Count | Source | 182 | 8.62k | static inline bool is_valid_endian_marker(const uint8_t* data, bool* isLittleEndian) { | 183 | | // II indicates Intel (little endian) and MM indicates motorola (big endian). | 184 | 8.62k | if (('I' != data[0] || 'I' != data[1]) && ('M' != data[0] || 'M' != data[1])) { | 185 | 3.95k | return false; | 186 | 3.95k | } | 187 | | | 188 | 4.67k | *isLittleEndian = ('I' == data[0]); | 189 | 4.67k | return true; | 190 | 4.67k | } |
Unexecuted instantiation: SkSampledCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkSwizzler.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkBmpBaseCodec.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkSVGDevice.cpp:is_valid_endian_marker(unsigned char const*, bool*) Unexecuted instantiation: SkAnimatedImage.cpp:is_valid_endian_marker(unsigned char const*, bool*) |
191 | | |
192 | 57.3k | static inline uint16_t get_endian_short(const uint8_t* data, bool littleEndian) { |
193 | 57.3k | if (littleEndian) { |
194 | 43.7k | return (data[1] << 8) | (data[0]); |
195 | 43.7k | } |
196 | | |
197 | 13.5k | return (data[0] << 8) | (data[1]); |
198 | 13.5k | } Unexecuted instantiation: SkCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkMasks.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkSampler.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkWbmpCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkHeifCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkJpegCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkJpegUtility.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkIcoCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkPngCodec.cpp:get_endian_short(unsigned char const*, bool) SkRawCodec.cpp:get_endian_short(unsigned char const*, bool) Line | Count | Source | 192 | 7.53k | static inline uint16_t get_endian_short(const uint8_t* data, bool littleEndian) { | 193 | 7.53k | if (littleEndian) { | 194 | 6.71k | return (data[1] << 8) | (data[0]); | 195 | 6.71k | } | 196 | | | 197 | 824 | return (data[0] << 8) | (data[1]); | 198 | 824 | } |
Unexecuted instantiation: SkWebpCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkWuffsCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkAndroidCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkBmpCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkBmpRLECodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkBmpStandardCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkMaskSwizzler.cpp:get_endian_short(unsigned char const*, bool) SkParseEncodedOrigin.cpp:get_endian_short(unsigned char const*, bool) Line | Count | Source | 192 | 49.8k | static inline uint16_t get_endian_short(const uint8_t* data, bool littleEndian) { | 193 | 49.8k | if (littleEndian) { | 194 | 37.0k | return (data[1] << 8) | (data[0]); | 195 | 37.0k | } | 196 | | | 197 | 12.7k | return (data[0] << 8) | (data[1]); | 198 | 12.7k | } |
Unexecuted instantiation: SkSampledCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkSwizzler.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkSVGDevice.cpp:get_endian_short(unsigned char const*, bool) Unexecuted instantiation: SkAnimatedImage.cpp:get_endian_short(unsigned char const*, bool) |
199 | | |
200 | 27.9k | static inline uint32_t get_endian_int(const uint8_t* data, bool littleEndian) { |
201 | 27.9k | if (littleEndian) { |
202 | 19.2k | return (data[3] << 24) | (data[2] << 16) | (data[1] << 8) | (data[0]); |
203 | 19.2k | } |
204 | | |
205 | 8.67k | return (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | (data[3]); |
206 | 8.67k | } Unexecuted instantiation: SkCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkMasks.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkSampler.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkWbmpCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkHeifCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkJpegCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkJpegDecoderMgr.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkJpegUtility.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkIcoCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkPngCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkRawCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkWebpCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkWuffsCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkAndroidCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkBmpCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkBmpMaskCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkBmpRLECodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkBmpStandardCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkMaskSwizzler.cpp:get_endian_int(unsigned char const*, bool) SkParseEncodedOrigin.cpp:get_endian_int(unsigned char const*, bool) Line | Count | Source | 200 | 27.9k | static inline uint32_t get_endian_int(const uint8_t* data, bool littleEndian) { | 201 | 27.9k | if (littleEndian) { | 202 | 19.2k | return (data[3] << 24) | (data[2] << 16) | (data[1] << 8) | (data[0]); | 203 | 19.2k | } | 204 | | | 205 | 8.67k | return (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | (data[3]); | 206 | 8.67k | } |
Unexecuted instantiation: SkSampledCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkSwizzler.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkBmpBaseCodec.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkSVGDevice.cpp:get_endian_int(unsigned char const*, bool) Unexecuted instantiation: SkAnimatedImage.cpp:get_endian_int(unsigned char const*, bool) |
207 | | |
208 | 937 | static inline SkPMColor premultiply_argb_as_rgba(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { |
209 | 937 | if (a != 255) { |
210 | 636 | r = SkMulDiv255Round(r, a); |
211 | 636 | g = SkMulDiv255Round(g, a); |
212 | 636 | b = SkMulDiv255Round(b, a); |
213 | 636 | } |
214 | | |
215 | 937 | return SkPackARGB_as_RGBA(a, r, g, b); |
216 | 937 | } Unexecuted instantiation: SkCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkMasks.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkSampler.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkIcoCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkPngCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkRawCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpMaskCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpRLECodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpStandardCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkMaskSwizzler.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkParseEncodedOrigin.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) SkSwizzler.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Line | Count | Source | 208 | 937 | static inline SkPMColor premultiply_argb_as_rgba(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { | 209 | 937 | if (a != 255) { | 210 | 636 | r = SkMulDiv255Round(r, a); | 211 | 636 | g = SkMulDiv255Round(g, a); | 212 | 636 | b = SkMulDiv255Round(b, a); | 213 | 636 | } | 214 | | | 215 | 937 | return SkPackARGB_as_RGBA(a, r, g, b); | 216 | 937 | } |
Unexecuted instantiation: SkBmpBaseCodec.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:premultiply_argb_as_rgba(unsigned int, unsigned int, unsigned int, unsigned int) |
217 | | |
218 | 587k | static inline SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { |
219 | 587k | if (a != 255) { |
220 | 557k | r = SkMulDiv255Round(r, a); |
221 | 557k | g = SkMulDiv255Round(g, a); |
222 | 557k | b = SkMulDiv255Round(b, a); |
223 | 557k | } |
224 | | |
225 | 587k | return SkPackARGB_as_BGRA(a, r, g, b); |
226 | 587k | } Unexecuted instantiation: SkCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkMasks.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkSampler.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkWbmpCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkHeifCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkJpegCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkJpegDecoderMgr.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkJpegUtility.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkIcoCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) SkPngCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Line | Count | Source | 218 | 1.63k | static inline SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { | 219 | 1.63k | if (a != 255) { | 220 | 1.30k | r = SkMulDiv255Round(r, a); | 221 | 1.30k | g = SkMulDiv255Round(g, a); | 222 | 1.30k | b = SkMulDiv255Round(b, a); | 223 | 1.30k | } | 224 | | | 225 | 1.63k | return SkPackARGB_as_BGRA(a, r, g, b); | 226 | 1.63k | } |
Unexecuted instantiation: SkRawCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkWebpCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkWuffsCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkAndroidCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpMaskCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpRLECodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkBmpStandardCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) SkMaskSwizzler.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Line | Count | Source | 218 | 7.58k | static inline SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { | 219 | 7.58k | if (a != 255) { | 220 | 5.89k | r = SkMulDiv255Round(r, a); | 221 | 5.89k | g = SkMulDiv255Round(g, a); | 222 | 5.89k | b = SkMulDiv255Round(b, a); | 223 | 5.89k | } | 224 | | | 225 | 7.58k | return SkPackARGB_as_BGRA(a, r, g, b); | 226 | 7.58k | } |
Unexecuted instantiation: SkParseEncodedOrigin.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkSampledCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) SkSwizzler.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Line | Count | Source | 218 | 578k | static inline SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CPU b) { | 219 | 578k | if (a != 255) { | 220 | 549k | r = SkMulDiv255Round(r, a); | 221 | 549k | g = SkMulDiv255Round(g, a); | 222 | 549k | b = SkMulDiv255Round(b, a); | 223 | 549k | } | 224 | | | 225 | 578k | return SkPackARGB_as_BGRA(a, r, g, b); | 226 | 578k | } |
Unexecuted instantiation: SkBmpBaseCodec.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkSVGDevice.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: SkAnimatedImage.cpp:premultiply_argb_as_bgra(unsigned int, unsigned int, unsigned int, unsigned int) |
227 | | |
228 | 882 | static inline bool is_rgba(SkColorType colorType) { |
229 | | #ifdef SK_PMCOLOR_IS_RGBA |
230 | | return (kBGRA_8888_SkColorType != colorType); |
231 | | #else |
232 | 882 | return (kRGBA_8888_SkColorType == colorType); |
233 | 882 | #endif |
234 | 882 | } Unexecuted instantiation: SkCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkMasks.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkSampler.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkWbmpCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkHeifCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkJpegCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkJpegDecoderMgr.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkJpegUtility.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkIcoCodec.cpp:is_rgba(SkColorType) SkPngCodec.cpp:is_rgba(SkColorType) Line | Count | Source | 228 | 464 | static inline bool is_rgba(SkColorType colorType) { | 229 | | #ifdef SK_PMCOLOR_IS_RGBA | 230 | | return (kBGRA_8888_SkColorType != colorType); | 231 | | #else | 232 | 464 | return (kRGBA_8888_SkColorType == colorType); | 233 | 464 | #endif | 234 | 464 | } |
Unexecuted instantiation: SkRawCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkWebpCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkWuffsCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkAndroidCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkBmpCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkBmpMaskCodec.cpp:is_rgba(SkColorType) SkBmpRLECodec.cpp:is_rgba(SkColorType) Line | Count | Source | 228 | 179 | static inline bool is_rgba(SkColorType colorType) { | 229 | | #ifdef SK_PMCOLOR_IS_RGBA | 230 | | return (kBGRA_8888_SkColorType != colorType); | 231 | | #else | 232 | 179 | return (kRGBA_8888_SkColorType == colorType); | 233 | 179 | #endif | 234 | 179 | } |
SkBmpStandardCodec.cpp:is_rgba(SkColorType) Line | Count | Source | 228 | 239 | static inline bool is_rgba(SkColorType colorType) { | 229 | | #ifdef SK_PMCOLOR_IS_RGBA | 230 | | return (kBGRA_8888_SkColorType != colorType); | 231 | | #else | 232 | 239 | return (kRGBA_8888_SkColorType == colorType); | 233 | 239 | #endif | 234 | 239 | } |
Unexecuted instantiation: SkMaskSwizzler.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkParseEncodedOrigin.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkSampledCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkSwizzler.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkBmpBaseCodec.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkSVGDevice.cpp:is_rgba(SkColorType) Unexecuted instantiation: SkAnimatedImage.cpp:is_rgba(SkColorType) |
235 | | |
236 | | // Method for coverting to a 32 bit pixel. |
237 | | typedef uint32_t (*PackColorProc)(U8CPU a, U8CPU r, U8CPU g, U8CPU b); |
238 | | |
239 | 462 | static inline PackColorProc choose_pack_color_proc(bool isPremul, SkColorType colorType) { |
240 | 462 | bool isRGBA = is_rgba(colorType); |
241 | 462 | if (isPremul) { |
242 | 37 | if (isRGBA) { |
243 | 0 | return &premultiply_argb_as_rgba; |
244 | 37 | } else { |
245 | 37 | return &premultiply_argb_as_bgra; |
246 | 37 | } |
247 | 425 | } else { |
248 | 425 | if (isRGBA) { |
249 | 0 | return &SkPackARGB_as_RGBA; |
250 | 425 | } else { |
251 | 425 | return &SkPackARGB_as_BGRA; |
252 | 425 | } |
253 | 425 | } |
254 | 462 | } Unexecuted instantiation: SkCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkMasks.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkSampler.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkWbmpCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkHeifCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkJpegCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkJpegDecoderMgr.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkJpegUtility.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkIcoCodec.cpp:choose_pack_color_proc(bool, SkColorType) SkPngCodec.cpp:choose_pack_color_proc(bool, SkColorType) Line | Count | Source | 239 | 44 | static inline PackColorProc choose_pack_color_proc(bool isPremul, SkColorType colorType) { | 240 | 44 | bool isRGBA = is_rgba(colorType); | 241 | 44 | if (isPremul) { | 242 | 37 | if (isRGBA) { | 243 | 0 | return &premultiply_argb_as_rgba; | 244 | 37 | } else { | 245 | 37 | return &premultiply_argb_as_bgra; | 246 | 37 | } | 247 | 7 | } else { | 248 | 7 | if (isRGBA) { | 249 | 0 | return &SkPackARGB_as_RGBA; | 250 | 7 | } else { | 251 | 7 | return &SkPackARGB_as_BGRA; | 252 | 7 | } | 253 | 7 | } | 254 | 44 | } |
Unexecuted instantiation: SkRawCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkWebpCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkWuffsCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkAndroidCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkAndroidCodecAdapter.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkBmpCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkBmpMaskCodec.cpp:choose_pack_color_proc(bool, SkColorType) SkBmpRLECodec.cpp:choose_pack_color_proc(bool, SkColorType) Line | Count | Source | 239 | 179 | static inline PackColorProc choose_pack_color_proc(bool isPremul, SkColorType colorType) { | 240 | 179 | bool isRGBA = is_rgba(colorType); | 241 | 179 | if (isPremul) { | 242 | 0 | if (isRGBA) { | 243 | 0 | return &premultiply_argb_as_rgba; | 244 | 0 | } else { | 245 | 0 | return &premultiply_argb_as_bgra; | 246 | 0 | } | 247 | 179 | } else { | 248 | 179 | if (isRGBA) { | 249 | 0 | return &SkPackARGB_as_RGBA; | 250 | 179 | } else { | 251 | 179 | return &SkPackARGB_as_BGRA; | 252 | 179 | } | 253 | 179 | } | 254 | 179 | } |
SkBmpStandardCodec.cpp:choose_pack_color_proc(bool, SkColorType) Line | Count | Source | 239 | 239 | static inline PackColorProc choose_pack_color_proc(bool isPremul, SkColorType colorType) { | 240 | 239 | bool isRGBA = is_rgba(colorType); | 241 | 239 | if (isPremul) { | 242 | 0 | if (isRGBA) { | 243 | 0 | return &premultiply_argb_as_rgba; | 244 | 0 | } else { | 245 | 0 | return &premultiply_argb_as_bgra; | 246 | 0 | } | 247 | 239 | } else { | 248 | 239 | if (isRGBA) { | 249 | 0 | return &SkPackARGB_as_RGBA; | 250 | 239 | } else { | 251 | 239 | return &SkPackARGB_as_BGRA; | 252 | 239 | } | 253 | 239 | } | 254 | 239 | } |
Unexecuted instantiation: SkMaskSwizzler.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkParseEncodedOrigin.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkSampledCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkSwizzler.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkBmpBaseCodec.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkSVGDevice.cpp:choose_pack_color_proc(bool, SkColorType) Unexecuted instantiation: SkAnimatedImage.cpp:choose_pack_color_proc(bool, SkColorType) |
255 | | |
256 | | bool is_orientation_marker(const uint8_t* data, size_t data_length, SkEncodedOrigin* orientation); |
257 | | |
258 | | #endif // SkCodecPriv_DEFINED |