Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Side by Side Diff: src/core/SkColorSpaceXform.h

Issue 2046013002: Optimize color xforms with 2.2 gammas for SSE2 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkColorSpaceXform_DEFINED 8 #ifndef SkColorSpaceXform_DEFINED
9 #define SkColorSpaceXform_DEFINED 9 #define SkColorSpaceXform_DEFINED
10 10
(...skipping 16 matching lines...) Expand all
27 /** 27 /**
28 * Apply the color conversion to a src buffer, storing the output in the ds t buffer. 28 * Apply the color conversion to a src buffer, storing the output in the ds t buffer.
29 * The src is stored in RGBA_8888 and the dst is stored in 8888 platform fo rmat. 29 * The src is stored in RGBA_8888 and the dst is stored in 8888 platform fo rmat.
30 * The output is not premultiplied. 30 * The output is not premultiplied.
31 */ 31 */
32 virtual void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t le n) const = 0; 32 virtual void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t le n) const = 0;
33 33
34 virtual ~SkColorSpaceXform() {} 34 virtual ~SkColorSpaceXform() {}
35 }; 35 };
36 36
37 class SkGammaByValueXform : public SkColorSpaceXform { 37 class Sk2Dot2Xform : public SkColorSpaceXform {
38 public: 38 public:
39 39
40 void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override; 40 void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
41 41
42 private: 42 private:
43 SkGammaByValueXform(float srcGammas[3], const SkMatrix44& srcToDst, float ds tGammas[3]); 43 Sk2Dot2Xform(const SkMatrix44& srcToDst);
44 44
45 float fSrcGammas[3]; 45 float fSrcToDst[16];
46 const SkMatrix44 fSrcToDst;
47 float fDstGammas[3];
48 46
49 friend class SkColorSpaceXform; 47 friend class SkColorSpaceXform;
50 }; 48 };
51 49
52 /** 50 /**
53 * Works for any valid src and dst profiles. 51 * Works for any valid src and dst profiles.
54 */ 52 */
55 class SkDefaultXform : public SkColorSpaceXform { 53 class SkDefaultXform : public SkColorSpaceXform {
56 public: 54 public:
57 55
58 void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override; 56 void xform_RGBA_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
59 57
60 private: 58 private:
61 SkDefaultXform(const sk_sp<SkGammas>& srcGammas, const SkMatrix44& srcToDst, 59 SkDefaultXform(const sk_sp<SkGammas>& srcGammas, const SkMatrix44& srcToDst,
62 const sk_sp<SkGammas>& dstGammas); 60 const sk_sp<SkGammas>& dstGammas);
63 61
64 sk_sp<SkGammas> fSrcGammas; 62 sk_sp<SkGammas> fSrcGammas;
65 const SkMatrix44 fSrcToDst; 63 const SkMatrix44 fSrcToDst;
66 sk_sp<SkGammas> fDstGammas; 64 sk_sp<SkGammas> fDstGammas;
67 65
68 friend class SkColorSpaceXform; 66 friend class SkColorSpaceXform;
69 friend class ColorSpaceXformTest; 67 friend class ColorSpaceXformTest;
70 }; 68 };
71 69
72 #endif 70 #endif
OLDNEW
« no previous file with comments | « bench/ColorCodecBench.cpp ('k') | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698