Revert of Make GrGLConfigConversionEffect work for Imagination and some other GPUs. (https://codereview.chromium.org/277323002/)
Reason for revert: Need to only use the highp variations on GLES contexts not GL contexts. http://108.170.220.120:10117/builders/Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Release/builds/3398/steps/RunTests/logs/stdio Original issue's description: > Make GrGLConfigConversionEffect work for Imagination and some other GPUs. > > BUG=372341 > > Committed: https://skia.googlesource.com/skia/+/93cf46f7d687128d2ad05762bd65fea6c4539553 R=tomhudson@chromium.org, changjun.yang@intel.com, rmistry@google.com, jcgregorio@google.com NOTREECHECKS=true NOTRY=true BUG=372341 Author: bsalomon@google.com Review URL: https://codereview.chromium.org/377263003
This commit is contained in:
parent
6132b436d8
commit
79fd216144
@ -37,7 +37,6 @@ public:
|
||||
builder->fsCodeAppendf("\t%s = %s.bgra;\n", outputColor, outputColor);
|
||||
} else {
|
||||
const char* swiz = fSwapRedAndBlue ? "bgr" : "rgb";
|
||||
const char* outputColorH = "outputColorH";
|
||||
switch (fPMConversion) {
|
||||
case GrConfigConversionEffect::kMulByAlpha_RoundUp_PMConversion:
|
||||
builder->fsCodeAppendf(
|
||||
@ -61,36 +60,6 @@ public:
|
||||
builder->fsCodeAppendf("\t\t%s = %s.a <= 0.0 ? vec4(0,0,0,0) : vec4(floor(%s.%s / %s.a * 255.0) / 255.0, %s.a);\n",
|
||||
outputColor, outputColor, outputColor, swiz, outputColor, outputColor);
|
||||
break;
|
||||
case GrConfigConversionEffect::kMulByAlpha_RoundUp_HIGHP_PMConversion:
|
||||
builder->fsCodeAppendf("\thighp vec4 %s;\n", outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColorH, outputColor);
|
||||
builder->fsCodeAppendf(
|
||||
"\t\t%s = vec4(ceil(%s.%s * %s.a * 255.0) / 255.0, %s.a);\n",
|
||||
outputColorH, outputColorH, swiz, outputColorH, outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColor, outputColorH);
|
||||
break;
|
||||
case GrConfigConversionEffect::kMulByAlpha_RoundDown_HIGHP_PMConversion:
|
||||
builder->fsCodeAppendf("\thighp vec4 %s;\n", outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColorH, outputColor);
|
||||
builder->fsCodeAppendf(
|
||||
"\t\t%s = vec4(floor(%s.%s * %s.a * 255.0) / 255.0, %s.a);\n",
|
||||
outputColorH, outputColorH, swiz, outputColorH, outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColor, outputColorH);
|
||||
break;
|
||||
case GrConfigConversionEffect::kDivByAlpha_RoundUp_HIGHP_PMConversion:
|
||||
builder->fsCodeAppendf("\thighp vec4 %s;\n", outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColorH, outputColor);
|
||||
builder->fsCodeAppendf("\t\t%s = %s.a <= 0.0 ? vec4(0,0,0,0) : vec4(ceil(%s.%s / %s.a * 255.0) / 255.0, %s.a);\n",
|
||||
outputColorH, outputColorH, outputColorH, swiz, outputColorH, outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColor, outputColorH);
|
||||
break;
|
||||
case GrConfigConversionEffect::kDivByAlpha_RoundDown_HIGHP_PMConversion:
|
||||
builder->fsCodeAppendf("\thighp vec4 %s;\n", outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColorH, outputColor);
|
||||
builder->fsCodeAppendf("\t\t%s = %s.a <= 0.0 ? vec4(0,0,0,0) : vec4(floor(%s.%s / %s.a * 255.0) / 255.0, %s.a);\n",
|
||||
outputColorH, outputColorH, outputColorH, swiz, outputColorH, outputColorH);
|
||||
builder->fsCodeAppendf("\t\t%s = %s;\n", outputColor, outputColorH);
|
||||
break;
|
||||
default:
|
||||
SkFAIL("Unknown conversion op.");
|
||||
break;
|
||||
@ -214,8 +183,6 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
|
||||
static const PMConversion kConversionRules[][2] = {
|
||||
{kDivByAlpha_RoundDown_PMConversion, kMulByAlpha_RoundUp_PMConversion},
|
||||
{kDivByAlpha_RoundUp_PMConversion, kMulByAlpha_RoundDown_PMConversion},
|
||||
{kDivByAlpha_RoundDown_HIGHP_PMConversion, kMulByAlpha_RoundUp_HIGHP_PMConversion},
|
||||
{kDivByAlpha_RoundUp_HIGHP_PMConversion, kMulByAlpha_RoundDown_HIGHP_PMConversion},
|
||||
};
|
||||
|
||||
GrContext::AutoWideOpenIdentityDraw awoid(context, NULL);
|
||||
|
@ -30,10 +30,6 @@ public:
|
||||
kMulByAlpha_RoundDown_PMConversion,
|
||||
kDivByAlpha_RoundUp_PMConversion,
|
||||
kDivByAlpha_RoundDown_PMConversion,
|
||||
kMulByAlpha_RoundUp_HIGHP_PMConversion,
|
||||
kMulByAlpha_RoundDown_HIGHP_PMConversion,
|
||||
kDivByAlpha_RoundUp_HIGHP_PMConversion,
|
||||
kDivByAlpha_RoundDown_HIGHP_PMConversion,
|
||||
|
||||
kPMConversionCnt
|
||||
};
|
||||
|
@ -630,6 +630,7 @@ void GrGLShaderBuilder::createAndEmitEffects(GrGLProgramEffectsBuilder* programE
|
||||
this->fsCodeAppendf("\tvec4 %s;\n", outColorName.c_str());
|
||||
outColor = outColorName;
|
||||
|
||||
|
||||
programEffectsBuilder->emitEffect(stage,
|
||||
effectKeys[e],
|
||||
outColor.c_str(),
|
||||
|
Loading…
Reference in New Issue
Block a user