aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-06-16 11:10:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-16 11:10:04 -0700
commit6a61a875467646f8dbc37cfecf49e12d1f475170 (patch)
treedb9b06850ce0d7f35fb9d21b14a0b1c431edb349 /bench
parentdea0340cadb759932e53416a657f5ea75fee8b5f (diff)
Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002 Review-Url: https://codereview.chromium.org/2069173002
Diffstat (limited to 'bench')
-rw-r--r--bench/GrMipMapBench.cpp2
-rw-r--r--bench/nanobench.cpp33
-rw-r--r--bench/nanobench.h2
3 files changed, 19 insertions, 18 deletions
diff --git a/bench/GrMipMapBench.cpp b/bench/GrMipMapBench.cpp
index f4e05a0ac7..096256c6cc 100644
--- a/bench/GrMipMapBench.cpp
+++ b/bench/GrMipMapBench.cpp
@@ -37,7 +37,7 @@ protected:
return;
}
SkImageInfo info = SkImageInfo::Make(fW, fH, kN32_SkColorType, kPremul_SkAlphaType,
- kSRGB_SkColorProfileType);
+ SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named));
fSurface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info);
}
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index e5a63a022d..94402cc770 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -424,7 +424,7 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
Benchmark::kGPU_Backend,
kN32_SkColorType,
kPremul_SkAlphaType,
- kLinear_SkColorProfileType,
+ nullptr,
sampleCount,
ctxType,
ctxOptions,
@@ -436,28 +436,29 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
}
#endif
- #define CPU_CONFIG(name, backend, color, alpha, profile) \
- if (config->getTag().equals(#name)) { \
- Config config = { \
- SkString(#name), Benchmark::backend, color, alpha, profile, \
- 0, kBogusContextType, kBogusContextOptions, false \
- }; \
- configs->push_back(config); \
- return; \
+ #define CPU_CONFIG(name, backend, color, alpha, colorSpace) \
+ if (config->getTag().equals(#name)) { \
+ Config config = { \
+ SkString(#name), Benchmark::backend, color, alpha, colorSpace, \
+ 0, kBogusContextType, kBogusContextOptions, false \
+ }; \
+ configs->push_back(config); \
+ return; \
}
if (FLAGS_cpu) {
CPU_CONFIG(nonrendering, kNonRendering_Backend,
- kUnknown_SkColorType, kUnpremul_SkAlphaType, kLinear_SkColorProfileType);
+ kUnknown_SkColorType, kUnpremul_SkAlphaType, nullptr)
CPU_CONFIG(8888, kRaster_Backend,
- kN32_SkColorType, kPremul_SkAlphaType, kLinear_SkColorProfileType)
+ kN32_SkColorType, kPremul_SkAlphaType, nullptr)
CPU_CONFIG(565, kRaster_Backend,
- kRGB_565_SkColorType, kOpaque_SkAlphaType, kLinear_SkColorProfileType)
+ kRGB_565_SkColorType, kOpaque_SkAlphaType, nullptr)
+ auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
CPU_CONFIG(srgb, kRaster_Backend,
- kN32_SkColorType, kPremul_SkAlphaType, kSRGB_SkColorProfileType)
+ kN32_SkColorType, kPremul_SkAlphaType, srgbColorSpace)
CPU_CONFIG(f16, kRaster_Backend,
- kRGBA_F16_SkColorType, kPremul_SkAlphaType, kLinear_SkColorProfileType)
+ kRGBA_F16_SkColorType, kPremul_SkAlphaType, nullptr)
}
#undef CPU_CONFIG
@@ -465,7 +466,7 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
if (config->getTag().equals("hwui")) {
Config config = { SkString("hwui"), Benchmark::kHWUI_Backend,
- kRGBA_8888_SkColorType, kPremul_SkAlphaType, kLinear_SkColorProfileType,
+ kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr,
0, kBogusContextType, kBogusContextOptions, false };
configs->push_back(config);
}
@@ -488,7 +489,7 @@ static Target* is_enabled(Benchmark* bench, const Config& config) {
}
SkImageInfo info = SkImageInfo::Make(bench->getSize().fX, bench->getSize().fY,
- config.color, config.alpha, config.profile);
+ config.color, config.alpha, config.colorSpace);
Target* target = nullptr;
diff --git a/bench/nanobench.h b/bench/nanobench.h
index ceab0f6c4f..ce1e33ec4f 100644
--- a/bench/nanobench.h
+++ b/bench/nanobench.h
@@ -26,7 +26,7 @@ struct Config {
Benchmark::Backend backend;
SkColorType color;
SkAlphaType alpha;
- SkColorProfileType profile;
+ sk_sp<SkColorSpace> colorSpace;
int samples;
#if SK_SUPPORT_GPU
sk_gpu_test::GrContextFactory::ContextType ctxType;