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

Unified Diff: src/core/SkColorSpaceXform.h

Issue 2130013002: Make all color xforms 'fast' (step 1) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Need to round to pass tests Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpaceXform.h
diff --git a/src/core/SkColorSpaceXform.h b/src/core/SkColorSpaceXform.h
index 723dea433570690a32850a2fe8c527cb777239e0..e09a7252ba5c376d37a8797d6aa46255cffb333d 100644
--- a/src/core/SkColorSpaceXform.h
+++ b/src/core/SkColorSpaceXform.h
@@ -34,16 +34,27 @@ public:
virtual ~SkColorSpaceXform() {}
};
-template <SkColorSpace::GammaNamed Src, SkColorSpace::GammaNamed Dst>
+template <SkColorSpace::GammaNamed Dst>
class SkFastXform : public SkColorSpaceXform {
public:
void xform_RGB1_8888(uint32_t* dst, const uint32_t* src, uint32_t len) const override;
private:
- SkFastXform(const SkMatrix44& srcToDst);
+ SkFastXform(const sk_sp<SkColorSpace>& srcSpace, const SkMatrix44& srcToDst,
+ const sk_sp<SkColorSpace>& dstSpace);
- float fSrcToDst[12];
+ static constexpr int kDstGammaTableSize = 1024;
+
+ // May contain pointers into storage or pointers into precomputed tables.
+ const float* fSrcGammaTables[3];
+ float fSrcGammaTableStorage[3 * 256];
+
+ float fSrcToDst[12];
+
+ // May contain pointers into storage or pointers into precomputed tables.
+ const uint8_t* fDstGammaTables[3];
+ uint8_t fDstGammaTableStorage[3 * kDstGammaTableSize];
friend class SkColorSpaceXform;
};
« no previous file with comments | « no previous file | src/core/SkColorSpaceXform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698