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

Unified Diff: bench/ColorCodecBench.cpp

Issue 2078623002: Support sRGB dsts in opt code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Drop parens 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dm/DM.cpp » ('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 621fc4191e4430c501ffbe19429aeac07e71802a..9dde5da813595fa6aa21ea4fe639dff2b5e53c92 100644
--- a/bench/ColorCodecBench.cpp
+++ b/bench/ColorCodecBench.cpp
@@ -12,9 +12,10 @@
#include "SkCommandLineFlags.h"
#if defined(SK_TEST_QCMS)
-DEFINE_bool(qcms, false, "Bench qcms color conversion");
+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");
ColorCodecBench::ColorCodecBench(const char* name, sk_sp<SkData> encoded)
: fEncoded(std::move(encoded))
@@ -170,7 +171,9 @@ void ColorCodecBench::onDelayedSetup() {
#if defined(SK_TEST_QCMS)
if (FLAGS_qcms) {
- fDstSpaceQCMS.reset(qcms_profile_from_memory(dstData->data(), dstData->size()));
+ fDstSpaceQCMS.reset(FLAGS_srgb ?
+ qcms_profile_sRGB() :
+ qcms_profile_from_memory(dstData->data(), dstData->size()));
SkASSERT(fDstSpaceQCMS);
// This call takes a non-trivial amount of time, but I think it's the most fair to
@@ -179,7 +182,8 @@ void ColorCodecBench::onDelayedSetup() {
} else
#endif
{
- fDstSpace = SkColorSpace::NewICC(dstData->data(), dstData->size());
+ fDstSpace = FLAGS_srgb ? SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) :
+ SkColorSpace::NewICC(dstData->data(), dstData->size());
SkASSERT(fDstSpace);
}
}
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698