aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-03-01 13:44:28 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-01 13:44:28 -0800
commit744898aa48e055401e5ef203d5f633e69825bf20 (patch)
treeac08a96d6f809ee67c65e85babc2db25e304959e /tools
parente7be3e5c7999230673c8272a2c73cb7261e735c6 (diff)
Revert of Progress on gamma-correctness in the GPU backend. Fixed conversion of color and profile type to pix… (patchset #1 id:1 of https://codereview.chromium.org/1750383002/ )
Reason for revert: GM breakage. Changes to SkGr.cpp appear to be altering behavior on a variety of tests. Debugging... Original issue's description: > Progress on gamma-correctness in the GPU backend. Fixed conversion of color and profile type to pixel config, which makes many things "just work". > > Added (color=8888|f16|srgb) option to gpu configurations, along with gpuf16, gpusrgb, and anglesrgb predefined configs. Runs the gpu backend in gamma-correct mode (with either FP16 linear or sRGB 8888 frambuffers). > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1750383002 > > Committed: https://skia.googlesource.com/skia/+/a6f58194733c1c50e4fe5f98585e42344f29b6f0 TBR=mtklein@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1755553003
Diffstat (limited to 'tools')
-rw-r--r--tools/flags/SkCommonFlagsConfig.cpp54
-rw-r--r--tools/flags/SkCommonFlagsConfig.h7
2 files changed, 7 insertions, 54 deletions
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
index 983a5018f0..c82e8de003 100644
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ b/tools/flags/SkCommonFlagsConfig.cpp
@@ -23,11 +23,11 @@ static const char defaultConfigs[] =
static const char configHelp[] =
"Options: 565 8888 debug gpu gpudebug gpudft gpunull "
- "msaa16 msaa4 gpuf16 gpusrgb nonrendering null nullgpu nvprmsaa16 nvprmsaa4 "
+ "msaa16 msaa4 nonrendering null nullgpu nvprmsaa16 nvprmsaa4 "
"pdf pdf_poppler skp svg xps"
#if SK_ANGLE
#ifdef SK_BUILD_FOR_WIN
- " angle anglesrgb"
+ " angle"
#endif
" angle-gl"
#endif
@@ -47,7 +47,7 @@ static const char configExtendedHelp[] =
"Possible backends and options:\n"
#if SK_SUPPORT_GPU
"\n"
- "gpu(api=string,color=string,dit=bool,nvpr=bool,samples=int)\tGPU backend\n"
+ "gpu(api=string,dit=bool,nvpr=bool,samples=int)\tGPU backend\n"
"\tapi\ttype: string\tdefault: native.\n"
"\t Select graphics API to use with gpu backend.\n"
"\t Options:\n"
@@ -69,12 +69,6 @@ static const char configExtendedHelp[] =
#if SK_MESA
"\t\tmesa\t\t\tUse MESA.\n"
#endif
- "\tcolor\ttype: string\tdefault: 8888.\n"
- "\t Select framebuffer color format.\n"
- "\t Options:\n"
- "\t\t8888\t\t\tLinear 8888.\n"
- "\t\tf16 \t\t\tLinear 16-bit floating point.\n"
- "\t\tsrgb\t\t\tsRGB 8888.\n"
"\tdit\ttype: bool\tdefault: false.\n"
"\t Use device independent text.\n"
"\tnvpr\ttype: bool\tdefault: false.\n"
@@ -88,8 +82,6 @@ static const char configExtendedHelp[] =
"\tmsaa16 \t= gpu(samples=16)\n"
"\tnvprmsaa4\t= gpu(nvpr=true,samples=4)\n"
"\tnvprmsaa16\t= gpu(nvpr=true,samples=16)\n"
- "\tgpuf16 \t= gpu(color=f16)\n"
- "\tgpusrgb \t= gpu(color=srgb)\n"
"\tgpudft \t= gpu(dit=true)\n"
"\tgpudebug \t= gpu(api=debug)\n"
"\tgpunull \t= gpu(api=null)\n"
@@ -98,7 +90,6 @@ static const char configExtendedHelp[] =
#if SK_ANGLE
#ifdef SK_BUILD_FOR_WIN
"\tangle \t= gpu(api=angle)\n"
- "\tanglesrgb \t= gpu(api=angle,color=srgb)\n"
#endif
"\tangle-gl \t= gpu(api=angle-gl)\n"
#endif
@@ -124,8 +115,6 @@ static const struct {
{ "msaa16", "gpu", "samples=16" },
{ "nvprmsaa4", "gpu", "nvpr=true,samples=4,dit=true" },
{ "nvprmsaa16", "gpu", "nvpr=true,samples=16,dit=true" },
- { "gpuf16", "gpu", "color=f16" },
- { "gpusrgb", "gpu", "color=srgb" },
{ "gpudft", "gpu", "dit=true" },
{ "gpudebug", "gpu", "api=debug" },
{ "gpunull", "gpu", "api=null" },
@@ -134,7 +123,6 @@ static const struct {
#if SK_ANGLE
#ifdef SK_BUILD_FOR_WIN
, { "angle", "gpu", "api=angle" }
- , { "anglesrgb", "gpu", "api=angle,color=srgb" }
#endif
, { "angle-gl", "gpu", "api=angle-gl" }
#endif
@@ -161,15 +149,12 @@ SkCommandLineConfig::~SkCommandLineConfig() {
#if SK_SUPPORT_GPU
SkCommandLineConfigGpu::SkCommandLineConfigGpu(
const SkString& tag, const SkTArray<SkString>& viaParts,
- ContextType contextType, bool useNVPR, bool useDIText, int samples,
- SkColorType colorType, SkColorProfileType profileType)
+ ContextType contextType, bool useNVPR, bool useDIText, int samples)
: SkCommandLineConfig(tag, SkString("gpu"), viaParts)
, fContextType(contextType)
, fUseNVPR(useNVPR)
, fUseDIText(useDIText)
- , fSamples(samples)
- , fColorType(colorType)
- , fProfileType(profileType) {
+ , fSamples(samples) {
}
static bool parse_option_int(const SkString& value, int* outInt) {
if (value.isEmpty()) {
@@ -246,26 +231,6 @@ static bool parse_option_gpu_api(const SkString& value,
#endif
return false;
}
-static bool parse_option_gpu_color(const SkString& value,
- SkColorType* outColorType,
- SkColorProfileType* outProfileType) {
- if (value.equals("8888")) {
- *outColorType = kN32_SkColorType;
- *outProfileType = kLinear_SkColorProfileType;
- return true;
- }
- if (value.equals("f16")) {
- *outColorType = kRGBA_F16_SkColorType;
- *outProfileType = kLinear_SkColorProfileType;
- return true;
- }
- if (value.equals("srgb")) {
- *outColorType = kN32_SkColorType;
- *outProfileType = kSRGB_SkColorProfileType;
- return true;
- }
- return false;
-}
SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
const SkTArray<SkString>& vias,
@@ -279,9 +244,6 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
bool useDIText = false;
bool seenSamples = false;
int samples = 0;
- bool seenColor = false;
- SkColorType colorType = kN32_SkColorType;
- SkColorProfileType profileType = kLinear_SkColorProfileType;
SkTArray<SkString> optionParts;
SkStrSplit(options.c_str(), ",", kStrict_SkStrSplitMode, &optionParts);
@@ -306,16 +268,12 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag,
} else if (key.equals("samples") && !seenSamples) {
valueOk = parse_option_int(value, &samples);
seenSamples = true;
- } else if (key.equals("color") && !seenColor) {
- valueOk = parse_option_gpu_color(value, &colorType, &profileType);
- seenColor = true;
}
if (!valueOk) {
return nullptr;
}
}
- return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useDIText, samples,
- colorType, profileType);
+ return new SkCommandLineConfigGpu(tag, vias, contextType, useNVPR, useDIText, samples);
}
#endif
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index 39f1f9788b..423cf1118c 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -52,23 +52,18 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig {
public:
typedef GrContextFactory::GLContextType ContextType;
SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts,
- ContextType contextType, bool useNVPR, bool useDIText, int samples,
- SkColorType colorType, SkColorProfileType profileType);
+ ContextType contextType, bool useNVPR, bool useDIText, int samples);
const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
ContextType getContextType() const { return fContextType; }
bool getUseNVPR() const { return fUseNVPR; }
bool getUseDIText() const { return fUseDIText; }
int getSamples() const { return fSamples; }
- SkColorType getColorType() const { return fColorType; }
- SkColorProfileType getProfileType() const { return fProfileType; }
private:
ContextType fContextType;
bool fUseNVPR;
bool fUseDIText;
int fSamples;
- SkColorType fColorType;
- SkColorProfileType fProfileType;
};
#endif