Remove a few exit-time destructors.
Bug: chromium:101600
Change-Id: I47da22b27703f4d47622f6f25bc1694a1bcc3099
Reviewed-on: https://skia-review.googlesource.com/158440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/src/effects/SkHighContrastFilter.cpp b/src/effects/SkHighContrastFilter.cpp
index 0d718a0..5fe01c6 100644
--- a/src/effects/SkHighContrastFilter.cpp
+++ b/src/effects/SkHighContrastFilter.cpp
@@ -299,7 +299,7 @@
fragBuilder->codeAppendf("l = 1.0 - l;");
// Convert back from HSL to RGB.
SkString hue2rgbFuncName;
- static const GrShaderVar gHue2rgbArgs[] = {
+ const GrShaderVar gHue2rgbArgs[] = {
GrShaderVar("p", kHalf_GrSLType),
GrShaderVar("q", kHalf_GrSLType),
GrShaderVar("t", kHalf_GrSLType),
diff --git a/src/effects/imagefilters/SkLightingImageFilter.cpp b/src/effects/imagefilters/SkLightingImageFilter.cpp
index de86718..33d853a 100644
--- a/src/effects/imagefilters/SkLightingImageFilter.cpp
+++ b/src/effects/imagefilters/SkLightingImageFilter.cpp
@@ -1819,7 +1819,7 @@
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
SkString lightFunc;
this->emitLightFunc(uniformHandler, fragBuilder, &lightFunc);
- static const GrShaderVar gSobelArgs[] = {
+ const GrShaderVar gSobelArgs[] = {
GrShaderVar("a", kHalf_GrSLType),
GrShaderVar("b", kHalf_GrSLType),
GrShaderVar("c", kHalf_GrSLType),
@@ -1837,7 +1837,7 @@
gSobelArgs,
"\treturn (-a + b - 2.0 * c + 2.0 * d -e + f) * scale;\n",
&sobelFuncName);
- static const GrShaderVar gPointToNormalArgs[] = {
+ const GrShaderVar gPointToNormalArgs[] = {
GrShaderVar("x", kHalf_GrSLType),
GrShaderVar("y", kHalf_GrSLType),
GrShaderVar("scale", kHalf_GrSLType),
@@ -1850,7 +1850,7 @@
"\treturn normalize(half3(-x * scale, -y * scale, 1));\n",
&pointToNormalName);
- static const GrShaderVar gInteriorNormalArgs[] = {
+ const GrShaderVar gInteriorNormalArgs[] = {
GrShaderVar("m", kHalf_GrSLType, 9),
GrShaderVar("surfaceScale", kHalf_GrSLType),
};
@@ -1938,7 +1938,7 @@
const char* kd;
fKDUni = uniformHandler->addUniform(kFragment_GrShaderFlag, kHalf_GrSLType, "KD", &kd);
- static const GrShaderVar gLightArgs[] = {
+ const GrShaderVar gLightArgs[] = {
GrShaderVar("normal", kHalf3_GrSLType),
GrShaderVar("surfaceToLight", kHalf3_GrSLType),
GrShaderVar("lightColor", kHalf3_GrSLType)
@@ -2034,7 +2034,7 @@
"Shininess",
&shininess);
- static const GrShaderVar gLightArgs[] = {
+ const GrShaderVar gLightArgs[] = {
GrShaderVar("normal", kHalf3_GrSLType),
GrShaderVar("surfaceToLight", kHalf3_GrSLType),
GrShaderVar("lightColor", kHalf3_GrSLType)
@@ -2164,7 +2164,7 @@
"ConeScale", &coneScale);
fSUni = uniformHandler->addUniform(kFragment_GrShaderFlag, kHalf3_GrSLType, "S", &s);
- static const GrShaderVar gLightColorArgs[] = {
+ const GrShaderVar gLightColorArgs[] = {
GrShaderVar("surfaceToLight", kHalf3_GrSLType)
};
SkString lightColorBody;
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index 0ac6af7..5dfff7e 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -256,7 +256,7 @@
// The bone matrices are passed in as 3x2 matrices in column-major order as groups
// of 3 float2s. This code takes those float2s and performs the matrix operation on
// a given matrix and float2.
- static const GrShaderVar gApplyBoneArgs[] = {
+ const GrShaderVar gApplyBoneArgs[] = {
GrShaderVar("index", kByte_GrSLType),
GrShaderVar("vec", kFloat2_GrSLType),
};
diff --git a/src/gpu/effects/GrSRGBEffect.cpp b/src/gpu/effects/GrSRGBEffect.cpp
index f4dfd3c..68680d1 100644
--- a/src/gpu/effects/GrSRGBEffect.cpp
+++ b/src/gpu/effects/GrSRGBEffect.cpp
@@ -19,7 +19,7 @@
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
SkString srgbFuncName;
- static const GrShaderVar gSrgbArgs[] = {
+ const GrShaderVar gSrgbArgs[] = {
GrShaderVar("x", kHalf_GrSLType),
};
switch (srgbe.mode()) {
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 73ac6e9..fd9669a 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -114,7 +114,7 @@
// Any combination of these may be present, although some configurations are much more likely.
auto emitTFFunc = [=](const char* name, GrGLSLProgramDataManager::UniformHandle uniform) {
- static const GrShaderVar gTFArgs[] = { GrShaderVar("x", kHalf_GrSLType) };
+ const GrShaderVar gTFArgs[] = { GrShaderVar("x", kHalf_GrSLType) };
const char* coeffs = uniformHandler->getUniformCStr(uniform);
SkString body;
// Temporaries to make evaluation line readable
@@ -146,7 +146,7 @@
SkString gamutXformFuncName;
if (colorXformHelper->applyGamutXform()) {
- static const GrShaderVar gGamutXformArgs[] = { GrShaderVar("color", kHalf4_GrSLType) };
+ const GrShaderVar gGamutXformArgs[] = { GrShaderVar("color", kHalf4_GrSLType) };
const char* xform = uniformHandler->getUniformCStr(colorXformHelper->gamutXformUniform());
SkString body;
body.appendf("color.rgb = (%s * color.rgb);", xform);
@@ -157,7 +157,7 @@
// Now define a wrapper function that applies all the intermediate steps
{
- static const GrShaderVar gColorXformArgs[] = { GrShaderVar("color", kHalf4_GrSLType) };
+ const GrShaderVar gColorXformArgs[] = { GrShaderVar("color", kHalf4_GrSLType) };
SkString body;
if (colorXformHelper->applyUnpremul()) {
body.append("half nonZeroAlpha = max(color.a, 0.00001);");
diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp
index dccd408..7153fa2 100644
--- a/src/shaders/SkPerlinNoiseShader.cpp
+++ b/src/shaders/SkPerlinNoiseShader.cpp
@@ -865,12 +865,12 @@
const char* dotLattice = "dot(((%s.ga + %s.rb * half2(%s)) * half2(2.0) - half2(1.0)), %s);";
// Add noise function
- static const GrShaderVar gPerlinNoiseArgs[] = {
+ const GrShaderVar gPerlinNoiseArgs[] = {
GrShaderVar(chanCoord, kHalf_GrSLType),
GrShaderVar(noiseVec, kHalf2_GrSLType)
};
- static const GrShaderVar gPerlinNoiseStitchArgs[] = {
+ const GrShaderVar gPerlinNoiseStitchArgs[] = {
GrShaderVar(chanCoord, kHalf_GrSLType),
GrShaderVar(noiseVec, kHalf2_GrSLType),
GrShaderVar(stitchData, kHalf2_GrSLType)
@@ -1256,7 +1256,7 @@
const char* zUni = uniformHandler->getUniformCStr(fZUni);
// fade function
- static const GrShaderVar fadeArgs[] = {
+ const GrShaderVar fadeArgs[] = {
GrShaderVar("t", kHalf3_GrSLType)
};
SkString fadeFuncName;
@@ -1266,7 +1266,7 @@
&fadeFuncName);
// perm function
- static const GrShaderVar permArgs[] = {
+ const GrShaderVar permArgs[] = {
GrShaderVar("x", kHalf_GrSLType)
};
SkString permFuncName;
@@ -1280,7 +1280,7 @@
permCode.c_str(), &permFuncName);
// grad function
- static const GrShaderVar gradArgs[] = {
+ const GrShaderVar gradArgs[] = {
GrShaderVar("x", kHalf_GrSLType),
GrShaderVar("p", kHalf3_GrSLType)
};
@@ -1293,7 +1293,7 @@
gradCode.c_str(), &gradFuncName);
// lerp function
- static const GrShaderVar lerpArgs[] = {
+ const GrShaderVar lerpArgs[] = {
GrShaderVar("a", kHalf_GrSLType),
GrShaderVar("b", kHalf_GrSLType),
GrShaderVar("w", kHalf_GrSLType)
@@ -1303,7 +1303,7 @@
"return a + w * (b - a);", &lerpFuncName);
// noise function
- static const GrShaderVar noiseArgs[] = {
+ const GrShaderVar noiseArgs[] = {
GrShaderVar("p", kHalf3_GrSLType),
};
SkString noiseFuncName;
@@ -1340,7 +1340,7 @@
noiseCode.c_str(), &noiseFuncName);
// noiseOctaves function
- static const GrShaderVar noiseOctavesArgs[] = {
+ const GrShaderVar noiseOctavesArgs[] = {
GrShaderVar("p", kHalf3_GrSLType)
};
SkString noiseOctavesFuncName;