Home
last modified time | relevance | path

Searched refs:Sk4f (Results 1 – 25 of 30) sorted by relevance

12

/external/skia/src/core/
DSkXfermode4f.cpp17 static Sk4f scale_by_coverage(const Sk4f& x4, uint8_t coverage) { in scale_by_coverage()
18 return x4 * Sk4f(coverage * (1/255.0f)); in scale_by_coverage()
21 static Sk4f lerp(const Sk4f& src, const Sk4f& dst, uint8_t srcCoverage) { in lerp()
22 return dst + (src - dst) * Sk4f(srcCoverage * (1/255.0f)); in lerp()
25 template <DstType D> Sk4f load_dst(SkPMColor dstC) { in load_dst()
29 static Sk4f srgb_4b_to_linear_unit(SkPMColor dstC) { in srgb_4b_to_linear_unit()
33 template <DstType D> uint32_t store_dst(const Sk4f& x4) { in store_dst()
37 static Sk4f linear_unit_to_srgb_255f(const Sk4f& l4) { in linear_unit_to_srgb_255f()
38 return linear_to_srgb(l4) * Sk4f(255) + Sk4f(0.5f); in linear_unit_to_srgb_255f()
49 Sk4f d4 = load_dst<D>(dst[i]); in general_1()
[all …]
DSkLinearBitmapPipeline.cpp29 virtual void VECTORCALL pointListFew(int n, Sk4f xs, Sk4f ys) = 0;
30 virtual void VECTORCALL pointList4(Sk4f xs, Sk4f ys) = 0;
61 virtual void VECTORCALL bilerpList(Sk4f xs, Sk4f ys) = 0;
68 virtual void VECTORCALL placePixel(Sk4f pixel0) = 0;
69 virtual void VECTORCALL place4Pixels(Sk4f p0, Sk4f p1, Sk4f p2, Sk4f p3) = 0;
100 Sk4f Xs = Sk4f(X(start)) + Sk4f{0.0f, 1.0f, 2.0f, 3.0f} * Sk4f{dx}; in span_fallback()
101 Sk4f Ys{Y(start)}; in span_fallback()
102 Sk4f fourDx = {4.0f * dx}; in span_fallback()
135 void VECTORCALL pointListFew(int n, Sk4f xs, Sk4f ys) override { in pointListFew()
140 void VECTORCALL pointList4(Sk4f xs, Sk4f ys) override { in pointList4()
[all …]
DSkPM4fPriv.h12 static inline float get_alpha(const Sk4f& f4) { in get_alpha()
16 static inline Sk4f set_alpha(const Sk4f& f4, float alpha) { in set_alpha()
18 return Sk4f(f4[0], f4[1], f4[2], alpha); in set_alpha()
21 static inline uint32_t to_4b(const Sk4f& f4) { in to_4b()
27 static inline Sk4f to_4f(uint32_t b4) { in to_4f()
31 static inline Sk4f srgb_to_linear(const Sk4f& s4) { in srgb_to_linear()
35 static inline Sk4f linear_to_srgb(const Sk4f& l4) { in linear_to_srgb()
41 static inline Sk4f Sk4f_fromL32(uint32_t src) { in Sk4f_fromL32()
42 return to_4f(src) * Sk4f(1.0f/255); in Sk4f_fromL32()
45 static inline Sk4f Sk4f_fromS32(uint32_t src) { in Sk4f_fromS32()
[all …]
DSkXfermodeU64.cpp24 static Sk4f lerp_by_coverage(const Sk4f& src, const Sk4f& dst, uint8_t srcCoverage) { in lerp_by_coverage()
25 return dst + (src - dst) * Sk4f(srcCoverage * (1/255.0f)); in lerp_by_coverage()
28 template <DstType D> Sk4f unit_to_bias(const Sk4f& x4) { in unit_to_bias()
29 return (D == kU16_Dst) ? x4 * Sk4f(65535) : x4; in unit_to_bias()
32 template <DstType D> Sk4f bias_to_unit(const Sk4f& x4) { in bias_to_unit()
33 return (D == kU16_Dst) ? x4 * Sk4f(1.0f/65535) : x4; in bias_to_unit()
37 static Sk4f load_from_u16(uint64_t value) { in load_from_u16()
42 static uint64_t store_to_u16(const Sk4f& x4) { in store_to_u16()
44 SkNx_cast<uint16_t>(x4 + Sk4f(0.5f)).store(&value); in store_to_u16()
50 template <DstType D> Sk4f load_from_dst(uint64_t dst) { in load_from_dst()
[all …]
DSkXfermode.cpp53 static Sk4f alpha(const Sk4f& color) { return Sk4f(color[3]); } in alpha()
54 static Sk4f inv_alpha(const Sk4f& color) { return Sk4f(1 - color[3]); } in inv_alpha()
55 static Sk4f pin_1(const Sk4f& value) { return Sk4f::Min(value, Sk4f(1)); } in pin_1()
57 static Sk4f color_alpha(const Sk4f& color, float newAlpha) { in color_alpha()
58 return Sk4f(color[0], color[1], color[2], newAlpha); in color_alpha()
60 static Sk4f color_alpha(const Sk4f& color, const Sk4f& newAlpha) { in color_alpha()
64 static Sk4f set_argb(float a, float r, float g, float b) { in set_argb()
66 return Sk4f(r, g, b, a); in set_argb()
68 return Sk4f(b, g, r, a); in set_argb()
72 static Sk4f clear_4f(const Sk4f& s, const Sk4f& d) { return Sk4f(0); } in clear_4f()
[all …]
DSkColorMatrixFilterRowMajor255.cpp63 static Sk4f scale_rgb(float scale) { in scale_rgb()
65 return Sk4f(scale, scale, scale, 1); in scale_rgb()
68 static Sk4f premul(const Sk4f& x) { in premul()
72 static Sk4f unpremul(const Sk4f& x) { in unpremul()
76 static Sk4f clamp_0_1(const Sk4f& x) { in clamp_0_1()
77 return Sk4f::Max(Sk4f::Min(x, Sk4f(1)), Sk4f(0)); in clamp_0_1()
80 static SkPMColor round(const Sk4f& x) { in round()
82 SkNx_cast<uint8_t>(x * Sk4f(255) + Sk4f(0.5f)).store(&c); in round()
89 const Sk4f c0 = Sk4f::Load(array + 0); in filter_span()
90 const Sk4f c1 = Sk4f::Load(array + 4); in filter_span()
[all …]
DSkBitmapFilter.h101 Sk4f evalcore_n(const Sk4f& val) const { in evalcore_n()
102 Sk4f x = val.abs(); in evalcore_n()
103 Sk4f over2 = x > Sk4f(2); in evalcore_n()
104 Sk4f over1 = x > Sk4f(1); in evalcore_n()
105 Sk4f poly1 = (((Sk4f(fA1) * x + Sk4f(fB1)) * x + Sk4f(fC1)) * x + Sk4f(fD1)) in evalcore_n()
106 * Sk4f(1.f/6.f); in evalcore_n()
107 Sk4f poly0 = ((Sk4f(fA2) * x + Sk4f(fB2)) * x*x + Sk4f(fD2)) * Sk4f(1.f/6.f); in evalcore_n()
108 return over2.thenElse(Sk4f(0), over1.thenElse(poly1, poly0)); in evalcore_n()
112 Sk4f sum(0); in evaluate_n()
119 Sk4f filterValue = evalcore_n(Sk4f(v0, v1, v2, v3)); in evaluate_n()
DSkColor.cpp110 Sk4f value = SkNx_cast<float>(Sk4b::Load(&c)); in FromPMColor()
112 (value * Sk4f(1.0f / 255)).store(&c4); in FromPMColor()
149 auto c4 = Sk4f::Load(fVec); in assertIsUnit()
150 SkASSERT((c4 >= Sk4f(0)).allTrue() && (c4 <= Sk4f(1)).allTrue()); in assertIsUnit()
157 Sk4f value = SkNx_shuffle<3,2,1,0>(SkNx_cast<float>(Sk4b::Load(&c))); in FromColor()
159 (value * Sk4f(1.0f / 255)).store(&c4); in FromColor()
165 Sk4f::Min(Sk4f::Max(Sk4f(a, r, g, b), Sk4f(0)), Sk4f(1)).store(c4.vec()); in Pin()
170 auto src = Sk4f::Load(this->pin().vec()); in premul()
172 src = src * Sk4f(1, srcAlpha, srcAlpha, srcAlpha); in premul()
176 Sk4f dst = SkNx_shuffle<3,2,1,0>(src); in premul()
[all …]
DSkColorSpace.cpp183 Sk4f cr, cg, cb; in SkApply3x3ToPM4f()
184 cg = Sk4f::Load(m.fMat + 3); in SkApply3x3ToPM4f()
187 cr = Sk4f::Load(m.fMat + 0); in SkApply3x3ToPM4f()
188 cb = Sk4f(m.fMat[6], m.fMat[7], m.fMat[8], 0); in SkApply3x3ToPM4f()
192 cb = Sk4f::Load(m.fMat + 0); in SkApply3x3ToPM4f()
193 cr = Sk4f(m.fMat[6], m.fMat[7], m.fMat[8], 0); in SkApply3x3ToPM4f()
195 cr = cr * Sk4f(1, 1, 1, 0); in SkApply3x3ToPM4f()
196 cg = cg * Sk4f(1, 1, 1, 0); in SkApply3x3ToPM4f()
197 cb = cb * Sk4f(1, 1, 1, 0); in SkApply3x3ToPM4f()
200 Sk4f r = Sk4f(src[i].fVec[SkPM4f::R]); in SkApply3x3ToPM4f()
[all …]
DSkHalf.h29 static inline Sk4f SkHalfToFloat_01(uint64_t);
30 static inline uint64_t SkFloatToHalf_01(const Sk4f&);
39 static inline Sk4f SkHalfToFloat_01(uint64_t hs) { in SkHalfToFloat_01()
89 return Sk4f::Load(fs); in SkHalfToFloat_01()
93 static inline uint64_t SkFloatToHalf_01(const Sk4f& fs) { in SkFloatToHalf_01()
DSkSpanProcs.cpp25 (SkNx_cast<float>(Sk4b::Load(&addr[i])) * Sk4f(1.0f/255)).store(span[i].fVec); in load_l32()
35 srgb_to_linear(SkNx_cast<float>(Sk4b::Load(&addr[i])) * Sk4f(1.0f/255)).store(span[i].fVec); in load_s32()
70 const Sk4f scale = Sk4f(paint.getAlpha() * (1.0f/255)); in alpha_filterspan()
72 (Sk4f::Load(span[i].fVec) * scale).store(span[i].fVec); in alpha_filterspan()
DSkColorFilter.cpp40 SkNx_cast<uint8_t>(Sk4f::Load(span[i].fVec) * Sk4f(255) + Sk4f(0.5f)).store(&tmp[i]); in filterSpan4f()
DSkNx.h189 typedef SkNx<4, float> Sk4f; typedef
208 void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) { in Sk4f_ToBytes()
/external/skia/src/effects/gradients/
DSk4fLinearGradient.cpp12 Sk4f premul_4f(const Sk4f& c) { in premul_4f()
15 return c * Sk4f(alpha, alpha, alpha, 1); in premul_4f()
19 SkPMColor trunc_from_255(const Sk4f& c) { in trunc_from_255()
30 void fill(const Sk4f& c, DstType* dst, int n);
33 void fill<SkPM4f, false>(const Sk4f& c, SkPM4f* dst, int n) { in fill()
41 void fill<SkPM4f, true>(const Sk4f& c, SkPM4f* dst, int n) { in fill()
46 void fill<SkPMColor, false>(const Sk4f& c, SkPMColor* dst, int n) { in fill()
51 void fill<SkPMColor, true>(const Sk4f& c, SkPMColor* dst, int n) { in fill()
56 void store(const Sk4f& color, DstType* dst);
59 void store<SkPM4f, false>(const Sk4f& c, SkPM4f* dst) { in store()
[all …]
DSk4fGradientBase.cpp33 const Sk4f& componentScale) in Interval()
39 const Sk4f c4f0 = SkNx_cast<float>(Sk4b::Load(&c0)) * componentScale; in Interval()
40 const Sk4f c4f1 = SkNx_cast<float>(Sk4b::Load(&c1)) * componentScale; in Interval()
41 const Sk4f dc4f = (c4f1 - c4f0) / (p1 - p0); in Interval()
48 Interval::Interval(const Sk4f& c0, const Sk4f& dc, in Interval()
130 const Sk4f componentScale = fColorsArePremul in GradientShaderBase4fContext()
131 ? Sk4f(paintAlpha * kInv255Float) in GradientShaderBase4fContext()
132 : Sk4f(kInv255Float, kInv255Float, kInv255Float, paintAlpha * kInv255Float); in GradientShaderBase4fContext()
216 Sk4f dc = Sk4f::Load(interval.fDc.fVec); in GradientShaderBase4fContext()
217 Sk4f c = Sk4f::Load(interval.fC0.fVec) + dc * Sk4f(p1 - p0); in GradientShaderBase4fContext()
[all …]
DSkRadialGradient.cpp95 static inline Sk4f fast_sqrt(const Sk4f& R) { in fast_sqrt()
100 static inline Sk4f sum_squares(const Sk4f& a, const Sk4f& b) { in sum_squares()
114 const Sk4f max(255); in shadeSpan_radial_clamp2()
120 const Sk4f fx4(sfx, sfx + sdx, sfx + 2*sdx, sfx + 3*sdx); in shadeSpan_radial_clamp2()
121 const Sk4f fy4(sfy, sfy + sdy, sfy + 2*sdy, sfy + 3*sdy); in shadeSpan_radial_clamp2()
122 const Sk4f dx4(sdx * 4); in shadeSpan_radial_clamp2()
123 const Sk4f dy4(sdy * 4); in shadeSpan_radial_clamp2()
125 Sk4f tmpxy = fx4 * dx4 + fy4 * dy4; in shadeSpan_radial_clamp2()
126 Sk4f tmpdxdy = sum_squares(dx4, dy4); in shadeSpan_radial_clamp2()
127 Sk4f R = sum_squares(fx4, fy4); in shadeSpan_radial_clamp2()
[all …]
DSkLinearGradient.cpp156 const Sk4f scale(1, 1, 1, paintAlpha); in LinearGradientContext()
538 template <bool apply_alpha> SkPMColor trunc_from_255(const Sk4f& x) { in trunc_from_255()
549 const Sk4f& c4, const Sk4f& c4other) { in fill()
554 template <bool apply_alpha> void fill(SkPMColor dst[], int count, const Sk4f& c4) { in fill()
569 static Sk4f lerp_color(float fx, const SkLinearGradient::LinearGradientContext::Rec* rec) { in lerp_color()
574 const Sk4f c0 = rec[0].fColor; in lerp_color()
575 const Sk4f c1 = rec[1].fColor; in lerp_color()
576 const Sk4f diffc = c1 - c0; in lerp_color()
579 return c0 + Sk4f(t) * diffc; in lerp_color()
582 template <bool apply_alpha> void ramp(SkPMColor dstC[], int n, const Sk4f& c, const Sk4f& dc, in ramp()
[all …]
DSk4fGradientBase.h31 const Sk4f& componentScale);
32 Interval(const Sk4f& c0, const Sk4f& dc,
DSkLinearGradient.h17 operator Sk4f() const { in Sk4f() function
18 return Sk4f::Load(fArray); in Sk4f()
21 Sk4fStorage& operator=(const Sk4f& src) {
/external/skia/src/opts/
DSkXfermode_opts.h117 struct Xfermode { Sk4f operator()(const Sk4f&, const Sk4f&) const; }; \
118 inline Sk4f Xfermode::operator()(const Sk4f& d, const Sk4f& s) const
120 static inline Sk4f a_rgb(const Sk4f& a, const Sk4f& rgb) { in a_rgb()
122 return a * Sk4f(0,0,0,1) + rgb * Sk4f(1,1,1,0); in a_rgb()
124 static inline Sk4f alphas(const Sk4f& f) { in alphas()
131 isa = Sk4f(1)-sa, in XFERMODE()
132 ida = Sk4f(1)-da; in XFERMODE()
136 otherwise = sa * Sk4f::Min(da, (d*sa)*(sa-s).approxInvert()) + s*ida + d*isa; in XFERMODE()
139 auto colors = (d == Sk4f(0)).thenElse(dstover, in XFERMODE()
147 isa = Sk4f(1)-sa, in XFERMODE()
[all …]
DSkColorCubeFilter_opts.h43 const Sk4f g0b0(g0*b0), in color_cube_filter_span()
53 Sk4f color(0.5f); // Starting from 0.5f gets us rounding for free. in color_cube_filter_span()
62 Sk4f sum = SkNx_cast<float>(Sk4b::Load(&lutColor00)) * g0b0; in color_cube_filter_span()
66 color = color + sum * Sk4f((float)colorToFactors[x][r]); in color_cube_filter_span()
69 color = color * Sk4f(a * (1.0f/255)); in color_cube_filter_span()
DSkNx_sse.h291 template<> /*static*/ inline Sk4f SkNx_cast<float, int>(const Sk4i& src) {
295 template <> /*static*/ inline Sk4i SkNx_cast<int, float>(const Sk4f& src) {
299 template<> /*static*/ inline Sk4h SkNx_cast<uint16_t, float>(const Sk4f& src) {
313 template<> /*static*/ inline Sk4b SkNx_cast<uint8_t, float>(const Sk4f& src) {
324 template<> /*static*/ inline Sk4f SkNx_cast<float, uint8_t>(const Sk4b& src) {
335 template<> /*static*/ inline Sk4f SkNx_cast<float, uint16_t>(const Sk4h& src) {
341 const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) { in Sk4f_ToBytes()
DSkNx_neon.h363 template<> inline Sk4h SkNx_cast<uint16_t, float>(const Sk4f& src) {
367 template<> inline Sk4f SkNx_cast<float, uint16_t>(const Sk4h& src) {
371 template<> inline Sk4b SkNx_cast<uint8_t, float>(const Sk4f& src) {
377 template<> inline Sk4f SkNx_cast<float, uint8_t>(const Sk4b& src) {
384 const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) { in Sk4f_ToBytes()
/external/skia/bench/
DSk4fBench.cpp32 Sk4f fs(1,2,3,4); in onDraw()
50 Sk4f fs(1,2,3,4); in onDraw()
65 Sk4f c0(0,0,255,255), in onDraw()
74 Sk4f a = c0 + dc*fx + Sk4f(0.5f), // add an extra 0.5f to get rounding for free. in onDraw()
/external/skia/tests/
DSkNxTest.cpp211 auto fs = Sk4f(0.0f, -0.0f, 2.0f, -4.0f).abs(); in DEF_TEST()
219 auto fs = Sk4f(0.4f, -0.4f, 0.6f, -0.6f).floor(); in DEF_TEST()
227 Sk4f f4(0,10,20,30); in DEF_TEST()
241 Sk4f f(-2.3f, 1.0f, 0.45f, 0.6f); in DEF_TEST()
270 auto f4 = Sk4f(15, 17, 257, 65535); in DEF_TEST()

12