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

Unified Diff: bench/ColorCodecBench.cpp

Issue 2413383002: Cache dst LUTs in SkColorSpaceXform (Closed)
Patch Set: Ref the storage on SkColorSpaceXform Created 4 years, 2 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 | include/core/SkColorSpaceXform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ColorCodecBench.cpp
diff --git a/bench/ColorCodecBench.cpp b/bench/ColorCodecBench.cpp
index 9ae5601d49ef512d8792ce1b25819e0505156c2b..6aa46d609f5877bb5e624ff66c4b45bf395a26c3 100644
--- a/bench/ColorCodecBench.cpp
+++ b/bench/ColorCodecBench.cpp
@@ -18,6 +18,7 @@ DEFINE_bool(qcms, false, "Bench qcms color conversion");
#endif
DEFINE_bool(xform_only, false, "Only time the color xform, do not include the decode time");
DEFINE_bool(srgb, false, "Convert to srgb dst space");
+DEFINE_bool(nonstd, false, "Convert to non-standard dst space");
DEFINE_bool(half, false, "Convert to half floats");
ColorCodecBench::ColorCodecBench(const char* name, sk_sp<SkData> encoded)
@@ -172,6 +173,13 @@ void ColorCodecBench::onDelayedSetup() {
fDstSpace = as_CSB(fDstSpace)->makeLinearGamma();
}
+ if (FLAGS_nonstd) {
+ float gammas[3] = { 1.8f, 2.0f, 2.5f, };
+ SkMatrix44 matrix = SkMatrix44(SkMatrix44::kUninitialized_Constructor);
+ matrix.set3x3(0.30f, 0.31f, 0.28f, 0.32f, 0.33f, 0.29f, 0.27f, 0.30f, 0.30f);
+ fDstSpace = SkColorSpace::NewRGB(gammas, matrix);
+ }
+
fDstInfo = fDstInfo.makeColorSpace(fDstSpace);
fDst.reset(fDstInfo.getSafeSize(fDstInfo.minRowBytes()));
« no previous file with comments | « no previous file | include/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698