/src/skia/src/core/SkMipmapHQDownSampler.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2023 Google Inc. |
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 | | #include "include/core/SkTypes.h" |
9 | | |
10 | | #ifndef SK_USE_DRAWING_MIPMAP_DOWNSAMPLER |
11 | | |
12 | | #include "include/private/SkColorData.h" |
13 | | #include "src/base/SkHalf.h" |
14 | | #include "src/base/SkVx.h" |
15 | | #include "src/core/SkMipmap.h" |
16 | | |
17 | | namespace { |
18 | | |
19 | | struct ColorTypeFilter_8888 { |
20 | | typedef uint32_t Type; |
21 | 1.95M | static skvx::Vec<4, uint16_t> Expand(uint32_t x) { |
22 | 1.95M | return skvx::cast<uint16_t>(skvx::byte4::Load(&x)); |
23 | 1.95M | } |
24 | 506k | static uint32_t Compact(const skvx::Vec<4, uint16_t>& x) { |
25 | 506k | uint32_t r; |
26 | 506k | skvx::cast<uint8_t>(x).store(&r); |
27 | 506k | return r; |
28 | 506k | } |
29 | | }; |
30 | | |
31 | | struct ColorTypeFilter_565 { |
32 | | typedef uint16_t Type; |
33 | 0 | static uint32_t Expand(uint16_t x) { |
34 | 0 | return (x & ~SK_G16_MASK_IN_PLACE) | ((x & SK_G16_MASK_IN_PLACE) << 16); |
35 | 0 | } |
36 | 0 | static uint16_t Compact(uint32_t x) { |
37 | 0 | return ((x & ~SK_G16_MASK_IN_PLACE) & 0xFFFF) | ((x >> 16) & SK_G16_MASK_IN_PLACE); |
38 | 0 | } |
39 | | }; |
40 | | |
41 | | struct ColorTypeFilter_4444 { |
42 | | typedef uint16_t Type; |
43 | 0 | static uint32_t Expand(uint16_t x) { |
44 | 0 | return (x & 0xF0F) | ((x & ~0xF0F) << 12); |
45 | 0 | } |
46 | 0 | static uint16_t Compact(uint32_t x) { |
47 | 0 | return (x & 0xF0F) | ((x >> 12) & ~0xF0F); |
48 | 0 | } |
49 | | }; |
50 | | |
51 | | struct ColorTypeFilter_8 { |
52 | | typedef uint8_t Type; |
53 | 45.5k | static unsigned Expand(unsigned x) { |
54 | 45.5k | return x; |
55 | 45.5k | } |
56 | 9.97k | static uint8_t Compact(unsigned x) { |
57 | 9.97k | return (uint8_t)x; |
58 | 9.97k | } |
59 | | }; |
60 | | |
61 | | struct ColorTypeFilter_Alpha_F16 { |
62 | | typedef uint16_t Type; |
63 | 0 | static skvx::float4 Expand(uint16_t x) { |
64 | 0 | uint64_t x4 = (uint64_t)x; // add 0s out to four lanes (0,0,0,x) |
65 | 0 | return from_half(skvx::half4::Load(&x4)); |
66 | 0 | } |
67 | 0 | static uint16_t Compact(const skvx::float4& x) { |
68 | 0 | uint64_t r; |
69 | 0 | to_half(x).store(&r); |
70 | 0 | return r & 0xFFFF; // but ignore the extra 3 here |
71 | 0 | } |
72 | | }; |
73 | | |
74 | | struct ColorTypeFilter_RGBA_F16 { |
75 | | typedef uint64_t Type; // SkHalf x4 |
76 | 0 | static skvx::float4 Expand(uint64_t x) { |
77 | 0 | return from_half(skvx::half4::Load(&x)); |
78 | 0 | } |
79 | 0 | static uint64_t Compact(const skvx::float4& x) { |
80 | 0 | uint64_t r; |
81 | 0 | to_half(x).store(&r); |
82 | 0 | return r; |
83 | 0 | } |
84 | | }; |
85 | | |
86 | | struct ColorTypeFilter_88 { |
87 | | typedef uint16_t Type; |
88 | 0 | static uint32_t Expand(uint16_t x) { |
89 | 0 | return (x & 0xFF) | ((x & ~0xFF) << 8); |
90 | 0 | } |
91 | 0 | static uint16_t Compact(uint32_t x) { |
92 | 0 | return (x & 0xFF) | ((x >> 8) & ~0xFF); |
93 | 0 | } |
94 | | }; |
95 | | |
96 | | struct ColorTypeFilter_1616 { |
97 | | typedef uint32_t Type; |
98 | 0 | static uint64_t Expand(uint32_t x) { |
99 | 0 | return (x & 0xFFFF) | ((x & ~0xFFFF) << 16); |
100 | 0 | } |
101 | 0 | static uint16_t Compact(uint64_t x) { |
102 | 0 | return (x & 0xFFFF) | ((x >> 16) & ~0xFFFF); |
103 | 0 | } |
104 | | }; |
105 | | |
106 | | struct ColorTypeFilter_F16F16 { |
107 | | typedef uint32_t Type; |
108 | 0 | static skvx::float4 Expand(uint32_t x) { |
109 | 0 | uint64_t x4 = (uint64_t)x; // // add 0s out to four lanes (0,0,x,x) |
110 | 0 | return from_half(skvx::half4::Load(&x4)); |
111 | 0 | } |
112 | 0 | static uint32_t Compact(const skvx::float4& x) { |
113 | 0 | uint64_t r; |
114 | 0 | to_half(x).store(&r); |
115 | 0 | return (uint32_t) (r & 0xFFFFFFFF); // but ignore the extra 2 here |
116 | 0 | } |
117 | | }; |
118 | | |
119 | | struct ColorTypeFilter_16161616 { |
120 | | typedef uint64_t Type; |
121 | 0 | static skvx::Vec<4, uint32_t> Expand(uint64_t x) { |
122 | 0 | return skvx::cast<uint32_t>(skvx::Vec<4, uint16_t>::Load(&x)); |
123 | 0 | } |
124 | 0 | static uint64_t Compact(const skvx::Vec<4, uint32_t>& x) { |
125 | 0 | uint64_t r; |
126 | 0 | skvx::cast<uint16_t>(x).store(&r); |
127 | 0 | return r; |
128 | 0 | } |
129 | | }; |
130 | | |
131 | | struct ColorTypeFilter_16 { |
132 | | typedef uint16_t Type; |
133 | 0 | static uint32_t Expand(uint16_t x) { |
134 | 0 | return x; |
135 | 0 | } |
136 | 0 | static uint16_t Compact(uint32_t x) { |
137 | 0 | return (uint16_t) x; |
138 | 0 | } |
139 | | }; |
140 | | |
141 | | struct ColorTypeFilter_1010102 { |
142 | | typedef uint32_t Type; |
143 | 0 | static uint64_t Expand(uint64_t x) { |
144 | 0 | return (((x ) & 0x3ff) ) | |
145 | 0 | (((x >> 10) & 0x3ff) << 20) | |
146 | 0 | (((x >> 20) & 0x3ff) << 40) | |
147 | 0 | (((x >> 30) & 0x3 ) << 60); |
148 | 0 | } |
149 | 0 | static uint32_t Compact(uint64_t x) { |
150 | 0 | return (((x ) & 0x3ff) ) | |
151 | 0 | (((x >> 20) & 0x3ff) << 10) | |
152 | 0 | (((x >> 40) & 0x3ff) << 20) | |
153 | 0 | (((x >> 60) & 0x3 ) << 30); |
154 | 0 | } |
155 | | }; |
156 | | |
157 | 393k | template <typename T> T add_121(const T& a, const T& b, const T& c) { |
158 | 393k | return a + b + b + c; |
159 | 393k | } SkMipmapHQDownSampler.cpp:skvx::Vec<4, unsigned short> (anonymous namespace)::add_121<skvx::Vec<4, unsigned short> >(skvx::Vec<4, unsigned short> const&, skvx::Vec<4, unsigned short> const&, skvx::Vec<4, unsigned short> const&) Line | Count | Source | 157 | 385k | template <typename T> T add_121(const T& a, const T& b, const T& c) { | 158 | 385k | return a + b + b + c; | 159 | 385k | } |
SkMipmapHQDownSampler.cpp:unsigned int (anonymous namespace)::add_121<unsigned int>(unsigned int const&, unsigned int const&, unsigned int const&) Line | Count | Source | 157 | 7.94k | template <typename T> T add_121(const T& a, const T& b, const T& c) { | 158 | 7.94k | return a + b + b + c; | 159 | 7.94k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:skvx::Vec<4, float> (anonymous namespace)::add_121<skvx::Vec<4, float> >(skvx::Vec<4, float> const&, skvx::Vec<4, float> const&, skvx::Vec<4, float> const&) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:unsigned long (anonymous namespace)::add_121<unsigned long>(unsigned long const&, unsigned long const&, unsigned long const&) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:skvx::Vec<4, unsigned int> (anonymous namespace)::add_121<skvx::Vec<4, unsigned int> >(skvx::Vec<4, unsigned int> const&, skvx::Vec<4, unsigned int> const&, skvx::Vec<4, unsigned int> const&) |
160 | | |
161 | 516k | template <typename T> T shift_right(const T& x, int bits) { |
162 | 516k | return x >> bits; |
163 | 516k | } SkMipmapHQDownSampler.cpp:skvx::Vec<4, unsigned short> (anonymous namespace)::shift_right<skvx::Vec<4, unsigned short> >(skvx::Vec<4, unsigned short> const&, int) Line | Count | Source | 161 | 506k | template <typename T> T shift_right(const T& x, int bits) { | 162 | 506k | return x >> bits; | 163 | 506k | } |
SkMipmapHQDownSampler.cpp:unsigned int (anonymous namespace)::shift_right<unsigned int>(unsigned int const&, int) Line | Count | Source | 161 | 9.97k | template <typename T> T shift_right(const T& x, int bits) { | 162 | 9.97k | return x >> bits; | 163 | 9.97k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:unsigned long (anonymous namespace)::shift_right<unsigned long>(unsigned long const&, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:skvx::Vec<4, unsigned int> (anonymous namespace)::shift_right<skvx::Vec<4, unsigned int> >(skvx::Vec<4, unsigned int> const&, int) |
164 | | |
165 | 0 | skvx::float4 shift_right(const skvx::float4& x, int bits) { |
166 | 0 | return x * (1.0f / (1 << bits)); |
167 | 0 | } |
168 | | |
169 | 59.6k | template <typename T> T shift_left(const T& x, int bits) { |
170 | 59.6k | return x << bits; |
171 | 59.6k | } SkMipmapHQDownSampler.cpp:skvx::Vec<4, unsigned short> (anonymous namespace)::shift_left<skvx::Vec<4, unsigned short> >(skvx::Vec<4, unsigned short> const&, int) Line | Count | Source | 169 | 57.6k | template <typename T> T shift_left(const T& x, int bits) { | 170 | 57.6k | return x << bits; | 171 | 57.6k | } |
SkMipmapHQDownSampler.cpp:unsigned int (anonymous namespace)::shift_left<unsigned int>(unsigned int const&, int) Line | Count | Source | 169 | 1.99k | template <typename T> T shift_left(const T& x, int bits) { | 170 | 1.99k | return x << bits; | 171 | 1.99k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:unsigned long (anonymous namespace)::shift_left<unsigned long>(unsigned long const&, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:skvx::Vec<4, unsigned int> (anonymous namespace)::shift_left<skvx::Vec<4, unsigned int> >(skvx::Vec<4, unsigned int> const&, int) |
172 | | |
173 | 0 | skvx::float4 shift_left(const skvx::float4& x, int bits) { |
174 | 0 | return x * (1 << bits); |
175 | 0 | } |
176 | | |
177 | | // |
178 | | // To produce each mip level, we need to filter down by 1/2 (e.g. 100x100 -> 50,50) |
179 | | // If the starting dimension is odd, we floor the size of the lower level (e.g. 101 -> 50) |
180 | | // In those (odd) cases, we use a triangle filter, with 1-pixel overlap between samplings, |
181 | | // else for even cases, we just use a 2x box filter. |
182 | | // |
183 | | // This produces 4 possible isotropic filters: 2x2 2x3 3x2 3x3 where WxH indicates the number of |
184 | | // src pixels we need to sample in each dimension to produce 1 dst pixel. |
185 | | // |
186 | | // OpenGL expects a full mipmap stack to contain anisotropic space as well. |
187 | | // This means a 100x1 image would continue down to a 50x1 image, 25x1 image... |
188 | | // Because of this, we need 4 more anisotropic filters: 1x2, 1x3, 2x1, 3x1. |
189 | | |
190 | 43.3k | template <typename F> void downsample_1_2(void* dst, const void* src, size_t srcRB, int count) { |
191 | 43.3k | SkASSERT(count > 0); |
192 | 43.3k | auto p0 = static_cast<const typename F::Type*>(src); |
193 | 43.3k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); |
194 | 43.3k | auto d = static_cast<typename F::Type*>(dst); |
195 | | |
196 | 86.6k | for (int i = 0; i < count; ++i) { |
197 | 43.3k | auto c00 = F::Expand(p0[0]); |
198 | 43.3k | auto c10 = F::Expand(p1[0]); |
199 | | |
200 | 43.3k | auto c = c00 + c10; |
201 | 43.3k | d[i] = F::Compact(shift_right(c, 1)); |
202 | 43.3k | p0 += 2; |
203 | 43.3k | p1 += 2; |
204 | 43.3k | } |
205 | 43.3k | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 190 | 42.9k | template <typename F> void downsample_1_2(void* dst, const void* src, size_t srcRB, int count) { | 191 | 42.9k | SkASSERT(count > 0); | 192 | 42.9k | auto p0 = static_cast<const typename F::Type*>(src); | 193 | 42.9k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 194 | 42.9k | auto d = static_cast<typename F::Type*>(dst); | 195 | | | 196 | 85.9k | for (int i = 0; i < count; ++i) { | 197 | 42.9k | auto c00 = F::Expand(p0[0]); | 198 | 42.9k | auto c10 = F::Expand(p1[0]); | 199 | | | 200 | 42.9k | auto c = c00 + c10; | 201 | 42.9k | d[i] = F::Compact(shift_right(c, 1)); | 202 | 42.9k | p0 += 2; | 203 | 42.9k | p1 += 2; | 204 | 42.9k | } | 205 | 42.9k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 190 | 384 | template <typename F> void downsample_1_2(void* dst, const void* src, size_t srcRB, int count) { | 191 | 384 | SkASSERT(count > 0); | 192 | 384 | auto p0 = static_cast<const typename F::Type*>(src); | 193 | 384 | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 194 | 384 | auto d = static_cast<typename F::Type*>(dst); | 195 | | | 196 | 768 | for (int i = 0; i < count; ++i) { | 197 | 384 | auto c00 = F::Expand(p0[0]); | 198 | 384 | auto c10 = F::Expand(p1[0]); | 199 | | | 200 | 384 | auto c = c00 + c10; | 201 | 384 | d[i] = F::Compact(shift_right(c, 1)); | 202 | 384 | p0 += 2; | 203 | 384 | p1 += 2; | 204 | 384 | } | 205 | 384 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_2<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
206 | | |
207 | 56.9k | template <typename F> void downsample_1_3(void* dst, const void* src, size_t srcRB, int count) { |
208 | 56.9k | SkASSERT(count > 0); |
209 | 56.9k | auto p0 = static_cast<const typename F::Type*>(src); |
210 | 56.9k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); |
211 | 56.9k | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); |
212 | 56.9k | auto d = static_cast<typename F::Type*>(dst); |
213 | | |
214 | 113k | for (int i = 0; i < count; ++i) { |
215 | 56.9k | auto c00 = F::Expand(p0[0]); |
216 | 56.9k | auto c10 = F::Expand(p1[0]); |
217 | 56.9k | auto c20 = F::Expand(p2[0]); |
218 | | |
219 | 56.9k | auto c = add_121(c00, c10, c20); |
220 | 56.9k | d[i] = F::Compact(shift_right(c, 2)); |
221 | 56.9k | p0 += 2; |
222 | 56.9k | p1 += 2; |
223 | 56.9k | p2 += 2; |
224 | 56.9k | } |
225 | 56.9k | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 207 | 56.6k | template <typename F> void downsample_1_3(void* dst, const void* src, size_t srcRB, int count) { | 208 | 56.6k | SkASSERT(count > 0); | 209 | 56.6k | auto p0 = static_cast<const typename F::Type*>(src); | 210 | 56.6k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 211 | 56.6k | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); | 212 | 56.6k | auto d = static_cast<typename F::Type*>(dst); | 213 | | | 214 | 113k | for (int i = 0; i < count; ++i) { | 215 | 56.6k | auto c00 = F::Expand(p0[0]); | 216 | 56.6k | auto c10 = F::Expand(p1[0]); | 217 | 56.6k | auto c20 = F::Expand(p2[0]); | 218 | | | 219 | 56.6k | auto c = add_121(c00, c10, c20); | 220 | 56.6k | d[i] = F::Compact(shift_right(c, 2)); | 221 | 56.6k | p0 += 2; | 222 | 56.6k | p1 += 2; | 223 | 56.6k | p2 += 2; | 224 | 56.6k | } | 225 | 56.6k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 207 | 247 | template <typename F> void downsample_1_3(void* dst, const void* src, size_t srcRB, int count) { | 208 | 247 | SkASSERT(count > 0); | 209 | 247 | auto p0 = static_cast<const typename F::Type*>(src); | 210 | 247 | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 211 | 247 | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); | 212 | 247 | auto d = static_cast<typename F::Type*>(dst); | 213 | | | 214 | 494 | for (int i = 0; i < count; ++i) { | 215 | 247 | auto c00 = F::Expand(p0[0]); | 216 | 247 | auto c10 = F::Expand(p1[0]); | 217 | 247 | auto c20 = F::Expand(p2[0]); | 218 | | | 219 | 247 | auto c = add_121(c00, c10, c20); | 220 | 247 | d[i] = F::Compact(shift_right(c, 2)); | 221 | 247 | p0 += 2; | 222 | 247 | p1 += 2; | 223 | 247 | p2 += 2; | 224 | 247 | } | 225 | 247 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_1_3<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
226 | | |
227 | 273 | template <typename F> void downsample_2_1(void* dst, const void* src, size_t srcRB, int count) { |
228 | 273 | SkASSERT(count > 0); |
229 | 273 | auto p0 = static_cast<const typename F::Type*>(src); |
230 | 273 | auto d = static_cast<typename F::Type*>(dst); |
231 | | |
232 | 46.0k | for (int i = 0; i < count; ++i) { |
233 | 45.8k | auto c00 = F::Expand(p0[0]); |
234 | 45.8k | auto c01 = F::Expand(p0[1]); |
235 | | |
236 | 45.8k | auto c = c00 + c01; |
237 | 45.8k | d[i] = F::Compact(shift_right(c, 1)); |
238 | 45.8k | p0 += 2; |
239 | 45.8k | } |
240 | 273 | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 227 | 217 | template <typename F> void downsample_2_1(void* dst, const void* src, size_t srcRB, int count) { | 228 | 217 | SkASSERT(count > 0); | 229 | 217 | auto p0 = static_cast<const typename F::Type*>(src); | 230 | 217 | auto d = static_cast<typename F::Type*>(dst); | 231 | | | 232 | 45.5k | for (int i = 0; i < count; ++i) { | 233 | 45.3k | auto c00 = F::Expand(p0[0]); | 234 | 45.3k | auto c01 = F::Expand(p0[1]); | 235 | | | 236 | 45.3k | auto c = c00 + c01; | 237 | 45.3k | d[i] = F::Compact(shift_right(c, 1)); | 238 | 45.3k | p0 += 2; | 239 | 45.3k | } | 240 | 217 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 227 | 56 | template <typename F> void downsample_2_1(void* dst, const void* src, size_t srcRB, int count) { | 228 | 56 | SkASSERT(count > 0); | 229 | 56 | auto p0 = static_cast<const typename F::Type*>(src); | 230 | 56 | auto d = static_cast<typename F::Type*>(dst); | 231 | | | 232 | 551 | for (int i = 0; i < count; ++i) { | 233 | 495 | auto c00 = F::Expand(p0[0]); | 234 | 495 | auto c01 = F::Expand(p0[1]); | 235 | | | 236 | 495 | auto c = c00 + c01; | 237 | 495 | d[i] = F::Compact(shift_right(c, 1)); | 238 | 495 | p0 += 2; | 239 | 495 | } | 240 | 56 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_1<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
241 | | |
242 | 9.47k | template <typename F> void downsample_2_2(void* dst, const void* src, size_t srcRB, int count) { |
243 | 9.47k | SkASSERT(count > 0); |
244 | 9.47k | auto p0 = static_cast<const typename F::Type*>(src); |
245 | 9.47k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); |
246 | 9.47k | auto d = static_cast<typename F::Type*>(dst); |
247 | | |
248 | 95.2k | for (int i = 0; i < count; ++i) { |
249 | 85.8k | auto c00 = F::Expand(p0[0]); |
250 | 85.8k | auto c01 = F::Expand(p0[1]); |
251 | 85.8k | auto c10 = F::Expand(p1[0]); |
252 | 85.8k | auto c11 = F::Expand(p1[1]); |
253 | | |
254 | 85.8k | auto c = c00 + c10 + c01 + c11; |
255 | 85.8k | d[i] = F::Compact(shift_right(c, 2)); |
256 | 85.8k | p0 += 2; |
257 | 85.8k | p1 += 2; |
258 | 85.8k | } |
259 | 9.47k | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 242 | 9.01k | template <typename F> void downsample_2_2(void* dst, const void* src, size_t srcRB, int count) { | 243 | 9.01k | SkASSERT(count > 0); | 244 | 9.01k | auto p0 = static_cast<const typename F::Type*>(src); | 245 | 9.01k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 246 | 9.01k | auto d = static_cast<typename F::Type*>(dst); | 247 | | | 248 | 91.8k | for (int i = 0; i < count; ++i) { | 249 | 82.8k | auto c00 = F::Expand(p0[0]); | 250 | 82.8k | auto c01 = F::Expand(p0[1]); | 251 | 82.8k | auto c10 = F::Expand(p1[0]); | 252 | 82.8k | auto c11 = F::Expand(p1[1]); | 253 | | | 254 | 82.8k | auto c = c00 + c10 + c01 + c11; | 255 | 82.8k | d[i] = F::Compact(shift_right(c, 2)); | 256 | 82.8k | p0 += 2; | 257 | 82.8k | p1 += 2; | 258 | 82.8k | } | 259 | 9.01k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 242 | 458 | template <typename F> void downsample_2_2(void* dst, const void* src, size_t srcRB, int count) { | 243 | 458 | SkASSERT(count > 0); | 244 | 458 | auto p0 = static_cast<const typename F::Type*>(src); | 245 | 458 | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 246 | 458 | auto d = static_cast<typename F::Type*>(dst); | 247 | | | 248 | 3.37k | for (int i = 0; i < count; ++i) { | 249 | 2.92k | auto c00 = F::Expand(p0[0]); | 250 | 2.92k | auto c01 = F::Expand(p0[1]); | 251 | 2.92k | auto c10 = F::Expand(p1[0]); | 252 | 2.92k | auto c11 = F::Expand(p1[1]); | 253 | | | 254 | 2.92k | auto c = c00 + c10 + c01 + c11; | 255 | 2.92k | d[i] = F::Compact(shift_right(c, 2)); | 256 | 2.92k | p0 += 2; | 257 | 2.92k | p1 += 2; | 258 | 2.92k | } | 259 | 458 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_2<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
260 | | |
261 | 14.0k | template <typename F> void downsample_2_3(void* dst, const void* src, size_t srcRB, int count) { |
262 | 14.0k | SkASSERT(count > 0); |
263 | 14.0k | auto p0 = static_cast<const typename F::Type*>(src); |
264 | 14.0k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); |
265 | 14.0k | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); |
266 | 14.0k | auto d = static_cast<typename F::Type*>(dst); |
267 | | |
268 | 88.1k | for (int i = 0; i < count; ++i) { |
269 | 74.1k | auto c00 = F::Expand(p0[0]); |
270 | 74.1k | auto c01 = F::Expand(p0[1]); |
271 | 74.1k | auto c10 = F::Expand(p1[0]); |
272 | 74.1k | auto c11 = F::Expand(p1[1]); |
273 | 74.1k | auto c20 = F::Expand(p2[0]); |
274 | 74.1k | auto c21 = F::Expand(p2[1]); |
275 | | |
276 | 74.1k | auto c = add_121(c00, c10, c20) + add_121(c01, c11, c21); |
277 | 74.1k | d[i] = F::Compact(shift_right(c, 3)); |
278 | 74.1k | p0 += 2; |
279 | 74.1k | p1 += 2; |
280 | 74.1k | p2 += 2; |
281 | 74.1k | } |
282 | 14.0k | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 261 | 13.7k | template <typename F> void downsample_2_3(void* dst, const void* src, size_t srcRB, int count) { | 262 | 13.7k | SkASSERT(count > 0); | 263 | 13.7k | auto p0 = static_cast<const typename F::Type*>(src); | 264 | 13.7k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 265 | 13.7k | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); | 266 | 13.7k | auto d = static_cast<typename F::Type*>(dst); | 267 | | | 268 | 86.4k | for (int i = 0; i < count; ++i) { | 269 | 72.6k | auto c00 = F::Expand(p0[0]); | 270 | 72.6k | auto c01 = F::Expand(p0[1]); | 271 | 72.6k | auto c10 = F::Expand(p1[0]); | 272 | 72.6k | auto c11 = F::Expand(p1[1]); | 273 | 72.6k | auto c20 = F::Expand(p2[0]); | 274 | 72.6k | auto c21 = F::Expand(p2[1]); | 275 | | | 276 | 72.6k | auto c = add_121(c00, c10, c20) + add_121(c01, c11, c21); | 277 | 72.6k | d[i] = F::Compact(shift_right(c, 3)); | 278 | 72.6k | p0 += 2; | 279 | 72.6k | p1 += 2; | 280 | 72.6k | p2 += 2; | 281 | 72.6k | } | 282 | 13.7k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 261 | 337 | template <typename F> void downsample_2_3(void* dst, const void* src, size_t srcRB, int count) { | 262 | 337 | SkASSERT(count > 0); | 263 | 337 | auto p0 = static_cast<const typename F::Type*>(src); | 264 | 337 | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 265 | 337 | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); | 266 | 337 | auto d = static_cast<typename F::Type*>(dst); | 267 | | | 268 | 1.76k | for (int i = 0; i < count; ++i) { | 269 | 1.42k | auto c00 = F::Expand(p0[0]); | 270 | 1.42k | auto c01 = F::Expand(p0[1]); | 271 | 1.42k | auto c10 = F::Expand(p1[0]); | 272 | 1.42k | auto c11 = F::Expand(p1[1]); | 273 | 1.42k | auto c20 = F::Expand(p2[0]); | 274 | 1.42k | auto c21 = F::Expand(p2[1]); | 275 | | | 276 | 1.42k | auto c = add_121(c00, c10, c20) + add_121(c01, c11, c21); | 277 | 1.42k | d[i] = F::Compact(shift_right(c, 3)); | 278 | 1.42k | p0 += 2; | 279 | 1.42k | p1 += 2; | 280 | 1.42k | p2 += 2; | 281 | 1.42k | } | 282 | 337 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_2_3<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
283 | | |
284 | 210 | template <typename F> void downsample_3_1(void* dst, const void* src, size_t srcRB, int count) { |
285 | 210 | SkASSERT(count > 0); |
286 | 210 | auto p0 = static_cast<const typename F::Type*>(src); |
287 | 210 | auto d = static_cast<typename F::Type*>(dst); |
288 | | |
289 | 210 | auto c02 = F::Expand(p0[0]); |
290 | 63.9k | for (int i = 0; i < count; ++i) { |
291 | 63.7k | auto c00 = c02; |
292 | 63.7k | auto c01 = F::Expand(p0[1]); |
293 | 63.7k | c02 = F::Expand(p0[2]); |
294 | | |
295 | 63.7k | auto c = add_121(c00, c01, c02); |
296 | 63.7k | d[i] = F::Compact(shift_right(c, 2)); |
297 | 63.7k | p0 += 2; |
298 | 63.7k | } |
299 | 210 | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 284 | 160 | template <typename F> void downsample_3_1(void* dst, const void* src, size_t srcRB, int count) { | 285 | 160 | SkASSERT(count > 0); | 286 | 160 | auto p0 = static_cast<const typename F::Type*>(src); | 287 | 160 | auto d = static_cast<typename F::Type*>(dst); | 288 | | | 289 | 160 | auto c02 = F::Expand(p0[0]); | 290 | 63.3k | for (int i = 0; i < count; ++i) { | 291 | 63.2k | auto c00 = c02; | 292 | 63.2k | auto c01 = F::Expand(p0[1]); | 293 | 63.2k | c02 = F::Expand(p0[2]); | 294 | | | 295 | 63.2k | auto c = add_121(c00, c01, c02); | 296 | 63.2k | d[i] = F::Compact(shift_right(c, 2)); | 297 | 63.2k | p0 += 2; | 298 | 63.2k | } | 299 | 160 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 284 | 50 | template <typename F> void downsample_3_1(void* dst, const void* src, size_t srcRB, int count) { | 285 | 50 | SkASSERT(count > 0); | 286 | 50 | auto p0 = static_cast<const typename F::Type*>(src); | 287 | 50 | auto d = static_cast<typename F::Type*>(dst); | 288 | | | 289 | 50 | auto c02 = F::Expand(p0[0]); | 290 | 591 | for (int i = 0; i < count; ++i) { | 291 | 541 | auto c00 = c02; | 292 | 541 | auto c01 = F::Expand(p0[1]); | 293 | 541 | c02 = F::Expand(p0[2]); | 294 | | | 295 | 541 | auto c = add_121(c00, c01, c02); | 296 | 541 | d[i] = F::Compact(shift_right(c, 2)); | 297 | 541 | p0 += 2; | 298 | 541 | } | 299 | 50 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_1<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
300 | | |
301 | 8.17k | template <typename F> void downsample_3_2(void* dst, const void* src, size_t srcRB, int count) { |
302 | 8.17k | SkASSERT(count > 0); |
303 | 8.17k | auto p0 = static_cast<const typename F::Type*>(src); |
304 | 8.17k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); |
305 | 8.17k | auto d = static_cast<typename F::Type*>(dst); |
306 | | |
307 | | // Given pixels: |
308 | | // a0 b0 c0 d0 e0 ... |
309 | | // a1 b1 c1 d1 e1 ... |
310 | | // We want: |
311 | | // (a0 + 2*b0 + c0 + a1 + 2*b1 + c1) / 8 |
312 | | // (c0 + 2*d0 + e0 + c1 + 2*d1 + e1) / 8 |
313 | | // ... |
314 | | |
315 | 8.17k | auto c0 = F::Expand(p0[0]); |
316 | 8.17k | auto c1 = F::Expand(p1[0]); |
317 | 8.17k | auto c = c0 + c1; |
318 | 95.1k | for (int i = 0; i < count; ++i) { |
319 | 87.0k | auto a = c; |
320 | | |
321 | 87.0k | auto b0 = F::Expand(p0[1]); |
322 | 87.0k | auto b1 = F::Expand(p1[1]); |
323 | 87.0k | auto b = b0 + b0 + b1 + b1; |
324 | | |
325 | 87.0k | c0 = F::Expand(p0[2]); |
326 | 87.0k | c1 = F::Expand(p1[2]); |
327 | 87.0k | c = c0 + c1; |
328 | | |
329 | 87.0k | auto sum = a + b + c; |
330 | 87.0k | d[i] = F::Compact(shift_right(sum, 3)); |
331 | 87.0k | p0 += 2; |
332 | 87.0k | p1 += 2; |
333 | 87.0k | } |
334 | 8.17k | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 301 | 7.72k | template <typename F> void downsample_3_2(void* dst, const void* src, size_t srcRB, int count) { | 302 | 7.72k | SkASSERT(count > 0); | 303 | 7.72k | auto p0 = static_cast<const typename F::Type*>(src); | 304 | 7.72k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 305 | 7.72k | auto d = static_cast<typename F::Type*>(dst); | 306 | | | 307 | | // Given pixels: | 308 | | // a0 b0 c0 d0 e0 ... | 309 | | // a1 b1 c1 d1 e1 ... | 310 | | // We want: | 311 | | // (a0 + 2*b0 + c0 + a1 + 2*b1 + c1) / 8 | 312 | | // (c0 + 2*d0 + e0 + c1 + 2*d1 + e1) / 8 | 313 | | // ... | 314 | | | 315 | 7.72k | auto c0 = F::Expand(p0[0]); | 316 | 7.72k | auto c1 = F::Expand(p1[0]); | 317 | 7.72k | auto c = c0 + c1; | 318 | 92.7k | for (int i = 0; i < count; ++i) { | 319 | 85.0k | auto a = c; | 320 | | | 321 | 85.0k | auto b0 = F::Expand(p0[1]); | 322 | 85.0k | auto b1 = F::Expand(p1[1]); | 323 | 85.0k | auto b = b0 + b0 + b1 + b1; | 324 | | | 325 | 85.0k | c0 = F::Expand(p0[2]); | 326 | 85.0k | c1 = F::Expand(p1[2]); | 327 | 85.0k | c = c0 + c1; | 328 | | | 329 | 85.0k | auto sum = a + b + c; | 330 | 85.0k | d[i] = F::Compact(shift_right(sum, 3)); | 331 | 85.0k | p0 += 2; | 332 | 85.0k | p1 += 2; | 333 | 85.0k | } | 334 | 7.72k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 301 | 457 | template <typename F> void downsample_3_2(void* dst, const void* src, size_t srcRB, int count) { | 302 | 457 | SkASSERT(count > 0); | 303 | 457 | auto p0 = static_cast<const typename F::Type*>(src); | 304 | 457 | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 305 | 457 | auto d = static_cast<typename F::Type*>(dst); | 306 | | | 307 | | // Given pixels: | 308 | | // a0 b0 c0 d0 e0 ... | 309 | | // a1 b1 c1 d1 e1 ... | 310 | | // We want: | 311 | | // (a0 + 2*b0 + c0 + a1 + 2*b1 + c1) / 8 | 312 | | // (c0 + 2*d0 + e0 + c1 + 2*d1 + e1) / 8 | 313 | | // ... | 314 | | | 315 | 457 | auto c0 = F::Expand(p0[0]); | 316 | 457 | auto c1 = F::Expand(p1[0]); | 317 | 457 | auto c = c0 + c1; | 318 | 2.42k | for (int i = 0; i < count; ++i) { | 319 | 1.96k | auto a = c; | 320 | | | 321 | 1.96k | auto b0 = F::Expand(p0[1]); | 322 | 1.96k | auto b1 = F::Expand(p1[1]); | 323 | 1.96k | auto b = b0 + b0 + b1 + b1; | 324 | | | 325 | 1.96k | c0 = F::Expand(p0[2]); | 326 | 1.96k | c1 = F::Expand(p1[2]); | 327 | 1.96k | c = c0 + c1; | 328 | | | 329 | 1.96k | auto sum = a + b + c; | 330 | 1.96k | d[i] = F::Compact(shift_right(sum, 3)); | 331 | 1.96k | p0 += 2; | 332 | 1.96k | p1 += 2; | 333 | 1.96k | } | 334 | 457 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_2<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
335 | | |
336 | 4.94k | template <typename F> void downsample_3_3(void* dst, const void* src, size_t srcRB, int count) { |
337 | 4.94k | SkASSERT(count > 0); |
338 | 4.94k | auto p0 = static_cast<const typename F::Type*>(src); |
339 | 4.94k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); |
340 | 4.94k | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); |
341 | 4.94k | auto d = static_cast<typename F::Type*>(dst); |
342 | | |
343 | | // Given pixels: |
344 | | // a0 b0 c0 d0 e0 ... |
345 | | // a1 b1 c1 d1 e1 ... |
346 | | // a2 b2 c2 d2 e2 ... |
347 | | // We want: |
348 | | // (a0 + 2*b0 + c0 + 2*a1 + 4*b1 + 2*c1 + a2 + 2*b2 + c2) / 16 |
349 | | // (c0 + 2*d0 + e0 + 2*c1 + 4*d1 + 2*e1 + c2 + 2*d2 + e2) / 16 |
350 | | // ... |
351 | | |
352 | 4.94k | auto c0 = F::Expand(p0[0]); |
353 | 4.94k | auto c1 = F::Expand(p1[0]); |
354 | 4.94k | auto c2 = F::Expand(p2[0]); |
355 | 4.94k | auto c = add_121(c0, c1, c2); |
356 | 64.6k | for (int i = 0; i < count; ++i) { |
357 | 59.6k | auto a = c; |
358 | | |
359 | 59.6k | auto b0 = F::Expand(p0[1]); |
360 | 59.6k | auto b1 = F::Expand(p1[1]); |
361 | 59.6k | auto b2 = F::Expand(p2[1]); |
362 | 59.6k | auto b = shift_left(add_121(b0, b1, b2), 1); |
363 | | |
364 | 59.6k | c0 = F::Expand(p0[2]); |
365 | 59.6k | c1 = F::Expand(p1[2]); |
366 | 59.6k | c2 = F::Expand(p2[2]); |
367 | 59.6k | c = add_121(c0, c1, c2); |
368 | | |
369 | 59.6k | auto sum = a + b + c; |
370 | 59.6k | d[i] = F::Compact(shift_right(sum, 4)); |
371 | 59.6k | p0 += 2; |
372 | 59.6k | p1 += 2; |
373 | 59.6k | p2 += 2; |
374 | 59.6k | } |
375 | 4.94k | } SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_8888>(void*, void const*, unsigned long, int) Line | Count | Source | 336 | 4.64k | template <typename F> void downsample_3_3(void* dst, const void* src, size_t srcRB, int count) { | 337 | 4.64k | SkASSERT(count > 0); | 338 | 4.64k | auto p0 = static_cast<const typename F::Type*>(src); | 339 | 4.64k | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 340 | 4.64k | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); | 341 | 4.64k | auto d = static_cast<typename F::Type*>(dst); | 342 | | | 343 | | // Given pixels: | 344 | | // a0 b0 c0 d0 e0 ... | 345 | | // a1 b1 c1 d1 e1 ... | 346 | | // a2 b2 c2 d2 e2 ... | 347 | | // We want: | 348 | | // (a0 + 2*b0 + c0 + 2*a1 + 4*b1 + 2*c1 + a2 + 2*b2 + c2) / 16 | 349 | | // (c0 + 2*d0 + e0 + 2*c1 + 4*d1 + 2*e1 + c2 + 2*d2 + e2) / 16 | 350 | | // ... | 351 | | | 352 | 4.64k | auto c0 = F::Expand(p0[0]); | 353 | 4.64k | auto c1 = F::Expand(p1[0]); | 354 | 4.64k | auto c2 = F::Expand(p2[0]); | 355 | 4.64k | auto c = add_121(c0, c1, c2); | 356 | 62.3k | for (int i = 0; i < count; ++i) { | 357 | 57.6k | auto a = c; | 358 | | | 359 | 57.6k | auto b0 = F::Expand(p0[1]); | 360 | 57.6k | auto b1 = F::Expand(p1[1]); | 361 | 57.6k | auto b2 = F::Expand(p2[1]); | 362 | 57.6k | auto b = shift_left(add_121(b0, b1, b2), 1); | 363 | | | 364 | 57.6k | c0 = F::Expand(p0[2]); | 365 | 57.6k | c1 = F::Expand(p1[2]); | 366 | 57.6k | c2 = F::Expand(p2[2]); | 367 | 57.6k | c = add_121(c0, c1, c2); | 368 | | | 369 | 57.6k | auto sum = a + b + c; | 370 | 57.6k | d[i] = F::Compact(shift_right(sum, 4)); | 371 | 57.6k | p0 += 2; | 372 | 57.6k | p1 += 2; | 373 | 57.6k | p2 += 2; | 374 | 57.6k | } | 375 | 4.64k | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_8>(void*, void const*, unsigned long, int) Line | Count | Source | 336 | 307 | template <typename F> void downsample_3_3(void* dst, const void* src, size_t srcRB, int count) { | 337 | 307 | SkASSERT(count > 0); | 338 | 307 | auto p0 = static_cast<const typename F::Type*>(src); | 339 | 307 | auto p1 = (const typename F::Type*)((const char*)p0 + srcRB); | 340 | 307 | auto p2 = (const typename F::Type*)((const char*)p1 + srcRB); | 341 | 307 | auto d = static_cast<typename F::Type*>(dst); | 342 | | | 343 | | // Given pixels: | 344 | | // a0 b0 c0 d0 e0 ... | 345 | | // a1 b1 c1 d1 e1 ... | 346 | | // a2 b2 c2 d2 e2 ... | 347 | | // We want: | 348 | | // (a0 + 2*b0 + c0 + 2*a1 + 4*b1 + 2*c1 + a2 + 2*b2 + c2) / 16 | 349 | | // (c0 + 2*d0 + e0 + 2*c1 + 4*d1 + 2*e1 + c2 + 2*d2 + e2) / 16 | 350 | | // ... | 351 | | | 352 | 307 | auto c0 = F::Expand(p0[0]); | 353 | 307 | auto c1 = F::Expand(p1[0]); | 354 | 307 | auto c2 = F::Expand(p2[0]); | 355 | 307 | auto c = add_121(c0, c1, c2); | 356 | 2.30k | for (int i = 0; i < count; ++i) { | 357 | 1.99k | auto a = c; | 358 | | | 359 | 1.99k | auto b0 = F::Expand(p0[1]); | 360 | 1.99k | auto b1 = F::Expand(p1[1]); | 361 | 1.99k | auto b2 = F::Expand(p2[1]); | 362 | 1.99k | auto b = shift_left(add_121(b0, b1, b2), 1); | 363 | | | 364 | 1.99k | c0 = F::Expand(p0[2]); | 365 | 1.99k | c1 = F::Expand(p1[2]); | 366 | 1.99k | c2 = F::Expand(p2[2]); | 367 | 1.99k | c = add_121(c0, c1, c2); | 368 | | | 369 | 1.99k | auto sum = a + b + c; | 370 | 1.99k | d[i] = F::Compact(shift_right(sum, 4)); | 371 | 1.99k | p0 += 2; | 372 | 1.99k | p1 += 2; | 373 | 1.99k | p2 += 2; | 374 | 1.99k | } | 375 | 307 | } |
Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_565>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_4444>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_RGBA_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_88>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_1616>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_1010102>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_Alpha_F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_F16F16>(void*, void const*, unsigned long, int) Unexecuted instantiation: SkMipmapHQDownSampler.cpp:void (anonymous namespace)::downsample_3_3<(anonymous namespace)::ColorTypeFilter_16161616>(void*, void const*, unsigned long, int) |
376 | | |
377 | | |
378 | | typedef void FilterProc(void*, const void* srcPtr, size_t srcRB, int count); |
379 | | |
380 | | struct HQDownSampler : SkMipmapDownSampler { |
381 | | FilterProc* proc_1_2 = nullptr; |
382 | | FilterProc* proc_1_3 = nullptr; |
383 | | FilterProc* proc_2_1 = nullptr; |
384 | | FilterProc* proc_2_2 = nullptr; |
385 | | FilterProc* proc_2_3 = nullptr; |
386 | | FilterProc* proc_3_1 = nullptr; |
387 | | FilterProc* proc_3_2 = nullptr; |
388 | | FilterProc* proc_3_3 = nullptr; |
389 | | |
390 | | void buildLevel(const SkPixmap& dst, const SkPixmap& src) override; |
391 | | }; |
392 | | |
393 | 1.58k | void HQDownSampler::buildLevel(const SkPixmap& dst, const SkPixmap& src) { |
394 | 1.58k | const int width = src.width(); |
395 | 1.58k | const int height = src.height(); |
396 | | |
397 | 1.58k | FilterProc* proc; |
398 | 1.58k | if (height & 1) { |
399 | 951 | if (height == 1) { // src-height is 1 |
400 | 483 | if (width & 1) { // src-width is 3 |
401 | 210 | proc = proc_3_1; |
402 | 273 | } else { // src-width is 2 |
403 | 273 | proc = proc_2_1; |
404 | 273 | } |
405 | 483 | } else { // src-height is 3 |
406 | 468 | if (width & 1) { |
407 | 302 | if (width == 1) { // src-width is 1 |
408 | 162 | proc = proc_1_3; |
409 | 162 | } else { // src-width is 3 |
410 | 140 | proc = proc_3_3; |
411 | 140 | } |
412 | 302 | } else { // src-width is 2 |
413 | 166 | proc = proc_2_3; |
414 | 166 | } |
415 | 468 | } |
416 | 951 | } else { // src-height is 2 |
417 | 636 | if (width & 1) { |
418 | 374 | if (width == 1) { // src-width is 1 |
419 | 205 | proc = proc_1_2; |
420 | 205 | } else { // src-width is 3 |
421 | 169 | proc = proc_3_2; |
422 | 169 | } |
423 | 374 | } else { // src-width is 2 |
424 | 262 | proc = proc_2_2; |
425 | 262 | } |
426 | 636 | } |
427 | | |
428 | 1.58k | const void* srcBasePtr = src.addr(); |
429 | 1.58k | const size_t srcRB = src.rowBytes(); |
430 | 1.58k | void* dstBasePtr = dst.writable_addr(); |
431 | | |
432 | 138k | for (int y = 0; y < dst.height(); y++) { |
433 | 137k | proc(dstBasePtr, srcBasePtr, srcRB, dst.width()); |
434 | 137k | srcBasePtr = (const char*)srcBasePtr + srcRB * 2; // jump two rows |
435 | 137k | dstBasePtr = ( char*)dstBasePtr + dst.rowBytes(); |
436 | 137k | } |
437 | 1.58k | } |
438 | | |
439 | | } // namespace |
440 | | |
441 | 303 | std::unique_ptr<SkMipmapDownSampler> SkMipmap::MakeDownSampler(const SkPixmap& root) { |
442 | 303 | FilterProc* proc_1_2 = nullptr; |
443 | 303 | FilterProc* proc_1_3 = nullptr; |
444 | 303 | FilterProc* proc_2_1 = nullptr; |
445 | 303 | FilterProc* proc_2_2 = nullptr; |
446 | 303 | FilterProc* proc_2_3 = nullptr; |
447 | 303 | FilterProc* proc_3_1 = nullptr; |
448 | 303 | FilterProc* proc_3_2 = nullptr; |
449 | 303 | FilterProc* proc_3_3 = nullptr; |
450 | | |
451 | 303 | switch (root.colorType()) { |
452 | 0 | case kRGBA_8888_SkColorType: |
453 | 163 | case kBGRA_8888_SkColorType: |
454 | 163 | proc_1_2 = downsample_1_2<ColorTypeFilter_8888>; |
455 | 163 | proc_1_3 = downsample_1_3<ColorTypeFilter_8888>; |
456 | 163 | proc_2_1 = downsample_2_1<ColorTypeFilter_8888>; |
457 | 163 | proc_2_2 = downsample_2_2<ColorTypeFilter_8888>; |
458 | 163 | proc_2_3 = downsample_2_3<ColorTypeFilter_8888>; |
459 | 163 | proc_3_1 = downsample_3_1<ColorTypeFilter_8888>; |
460 | 163 | proc_3_2 = downsample_3_2<ColorTypeFilter_8888>; |
461 | 163 | proc_3_3 = downsample_3_3<ColorTypeFilter_8888>; |
462 | 163 | break; |
463 | 0 | case kRGB_565_SkColorType: |
464 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_565>; |
465 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_565>; |
466 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_565>; |
467 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_565>; |
468 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_565>; |
469 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_565>; |
470 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_565>; |
471 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_565>; |
472 | 0 | break; |
473 | 0 | case kARGB_4444_SkColorType: |
474 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_4444>; |
475 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_4444>; |
476 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_4444>; |
477 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_4444>; |
478 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_4444>; |
479 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_4444>; |
480 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_4444>; |
481 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_4444>; |
482 | 0 | break; |
483 | 140 | case kAlpha_8_SkColorType: |
484 | 140 | case kGray_8_SkColorType: |
485 | 140 | case kR8_unorm_SkColorType: |
486 | 140 | proc_1_2 = downsample_1_2<ColorTypeFilter_8>; |
487 | 140 | proc_1_3 = downsample_1_3<ColorTypeFilter_8>; |
488 | 140 | proc_2_1 = downsample_2_1<ColorTypeFilter_8>; |
489 | 140 | proc_2_2 = downsample_2_2<ColorTypeFilter_8>; |
490 | 140 | proc_2_3 = downsample_2_3<ColorTypeFilter_8>; |
491 | 140 | proc_3_1 = downsample_3_1<ColorTypeFilter_8>; |
492 | 140 | proc_3_2 = downsample_3_2<ColorTypeFilter_8>; |
493 | 140 | proc_3_3 = downsample_3_3<ColorTypeFilter_8>; |
494 | 140 | break; |
495 | 0 | case kRGBA_F16Norm_SkColorType: |
496 | 0 | case kRGBA_F16_SkColorType: |
497 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_RGBA_F16>; |
498 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_RGBA_F16>; |
499 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_RGBA_F16>; |
500 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_RGBA_F16>; |
501 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_RGBA_F16>; |
502 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_RGBA_F16>; |
503 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_RGBA_F16>; |
504 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_RGBA_F16>; |
505 | 0 | break; |
506 | 0 | case kR8G8_unorm_SkColorType: |
507 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_88>; |
508 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_88>; |
509 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_88>; |
510 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_88>; |
511 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_88>; |
512 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_88>; |
513 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_88>; |
514 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_88>; |
515 | 0 | break; |
516 | 0 | case kR16G16_unorm_SkColorType: |
517 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_1616>; |
518 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_1616>; |
519 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_1616>; |
520 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_1616>; |
521 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_1616>; |
522 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_1616>; |
523 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_1616>; |
524 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_1616>; |
525 | 0 | break; |
526 | 0 | case kA16_unorm_SkColorType: |
527 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_16>; |
528 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_16>; |
529 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_16>; |
530 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_16>; |
531 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_16>; |
532 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_16>; |
533 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_16>; |
534 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_16>; |
535 | 0 | break; |
536 | 0 | case kRGBA_1010102_SkColorType: |
537 | 0 | case kBGRA_1010102_SkColorType: |
538 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_1010102>; |
539 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_1010102>; |
540 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_1010102>; |
541 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_1010102>; |
542 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_1010102>; |
543 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_1010102>; |
544 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_1010102>; |
545 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_1010102>; |
546 | 0 | break; |
547 | 0 | case kA16_float_SkColorType: |
548 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_Alpha_F16>; |
549 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_Alpha_F16>; |
550 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_Alpha_F16>; |
551 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_Alpha_F16>; |
552 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_Alpha_F16>; |
553 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_Alpha_F16>; |
554 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_Alpha_F16>; |
555 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_Alpha_F16>; |
556 | 0 | break; |
557 | 0 | case kR16G16_float_SkColorType: |
558 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_F16F16>; |
559 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_F16F16>; |
560 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_F16F16>; |
561 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_F16F16>; |
562 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_F16F16>; |
563 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_F16F16>; |
564 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_F16F16>; |
565 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_F16F16>; |
566 | 0 | break; |
567 | 0 | case kR16G16B16A16_unorm_SkColorType: |
568 | 0 | proc_1_2 = downsample_1_2<ColorTypeFilter_16161616>; |
569 | 0 | proc_1_3 = downsample_1_3<ColorTypeFilter_16161616>; |
570 | 0 | proc_2_1 = downsample_2_1<ColorTypeFilter_16161616>; |
571 | 0 | proc_2_2 = downsample_2_2<ColorTypeFilter_16161616>; |
572 | 0 | proc_2_3 = downsample_2_3<ColorTypeFilter_16161616>; |
573 | 0 | proc_3_1 = downsample_3_1<ColorTypeFilter_16161616>; |
574 | 0 | proc_3_2 = downsample_3_2<ColorTypeFilter_16161616>; |
575 | 0 | proc_3_3 = downsample_3_3<ColorTypeFilter_16161616>; |
576 | 0 | break; |
577 | | |
578 | 0 | case kUnknown_SkColorType: |
579 | 0 | case kRGB_888x_SkColorType: // TODO: use 8888? |
580 | 0 | case kRGB_101010x_SkColorType: // TODO: use 1010102? |
581 | 0 | case kBGR_101010x_SkColorType: // TODO: use 1010102? |
582 | 0 | case kBGR_101010x_XR_SkColorType: // TODO: use 1010102? |
583 | 0 | case kBGRA_10101010_XR_SkColorType: |
584 | 0 | case kRGBA_10x6_SkColorType: |
585 | 0 | case kRGBA_F32_SkColorType: |
586 | 0 | return nullptr; |
587 | | |
588 | 0 | case kSRGBA_8888_SkColorType: // TODO: needs careful handling |
589 | 0 | return nullptr; |
590 | 303 | } |
591 | | |
592 | 303 | auto sampler = std::make_unique<HQDownSampler>(); |
593 | 303 | sampler->proc_1_2 = proc_1_2; |
594 | 303 | sampler->proc_1_3 = proc_1_3; |
595 | 303 | sampler->proc_2_1 = proc_2_1; |
596 | 303 | sampler->proc_2_2 = proc_2_2; |
597 | 303 | sampler->proc_2_3 = proc_2_3; |
598 | 303 | sampler->proc_3_1 = proc_3_1; |
599 | 303 | sampler->proc_3_2 = proc_3_2; |
600 | 303 | sampler->proc_3_3 = proc_3_3; |
601 | 303 | return sampler; |
602 | 303 | } |
603 | | |
604 | | #endif |