moved files generated from .fp files into generated/ directories
Bug: skia:
Change-Id: I8605cdfcc0b1c56c23a6075c7fe188ab7384681c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207221
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 625427a..32c03af 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -7,8 +7,8 @@
#include "GrConvexPolyEffect.h"
#include "SkPathPriv.h"
-#include "effects/GrAARectEffect.h"
-#include "effects/GrConstColorProcessor.h"
+#include "effects/generated/GrAARectEffect.h"
+#include "effects/generated/GrConstColorProcessor.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index a475ec0..cb8e689 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -7,8 +7,8 @@
#include "GrOvalEffect.h"
-#include "GrCircleEffect.h"
-#include "GrEllipseEffect.h"
+#include "generated/GrCircleEffect.h"
+#include "generated/GrEllipseEffect.h"
#include "SkRect.h"
std::unique_ptr<GrFragmentProcessor> GrOvalEffect::Make(GrClipEdgeType edgeType, const SkRect& oval,
diff --git a/src/gpu/effects/GrSkSLFP.cpp b/src/gpu/effects/GrSkSLFP.cpp
index 1c7673e..2e628ea 100644
--- a/src/gpu/effects/GrSkSLFP.cpp
+++ b/src/gpu/effects/GrSkSLFP.cpp
@@ -474,7 +474,7 @@
#if GR_TEST_UTILS
-#include "GrConstColorProcessor.h"
+#include "generated/GrConstColorProcessor.h"
#include "GrContext.h"
#include "SkArithmeticImageFilter.h"
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 3cc2a1f..7121bac 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -9,10 +9,10 @@
#include "GrProxyProvider.h"
#include "GrShaderCaps.h"
-#include "GrSimpleTextureEffect.h"
#include "GrSurfaceProxyPriv.h"
#include "GrTexture.h"
#include "SkFloatingPoint.h"
+#include "generated/GrSimpleTextureEffect.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index e207e15..e3064bf 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -7,8 +7,8 @@
#include "GrXfermodeFragmentProcessor.h"
-#include "GrConstColorProcessor.h"
#include "GrFragmentProcessor.h"
+#include "generated/GrConstColorProcessor.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLBlend.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
diff --git a/src/gpu/effects/GrAARectEffect.cpp b/src/gpu/effects/generated/GrAARectEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrAARectEffect.cpp
rename to src/gpu/effects/generated/GrAARectEffect.cpp
diff --git a/src/gpu/effects/GrAARectEffect.h b/src/gpu/effects/generated/GrAARectEffect.h
similarity index 100%
rename from src/gpu/effects/GrAARectEffect.h
rename to src/gpu/effects/generated/GrAARectEffect.h
diff --git a/src/gpu/effects/GrAlphaThresholdFragmentProcessor.cpp b/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp
similarity index 100%
rename from src/gpu/effects/GrAlphaThresholdFragmentProcessor.cpp
rename to src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.cpp
diff --git a/src/gpu/effects/GrAlphaThresholdFragmentProcessor.h b/src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h
similarity index 100%
rename from src/gpu/effects/GrAlphaThresholdFragmentProcessor.h
rename to src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h
diff --git a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp b/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.cpp
similarity index 100%
rename from src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp
rename to src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.cpp
diff --git a/src/gpu/effects/GrBlurredEdgeFragmentProcessor.h b/src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h
similarity index 100%
rename from src/gpu/effects/GrBlurredEdgeFragmentProcessor.h
rename to src/gpu/effects/generated/GrBlurredEdgeFragmentProcessor.h
diff --git a/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp b/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.cpp
similarity index 100%
rename from src/gpu/effects/GrCircleBlurFragmentProcessor.cpp
rename to src/gpu/effects/generated/GrCircleBlurFragmentProcessor.cpp
diff --git a/src/gpu/effects/GrCircleBlurFragmentProcessor.h b/src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h
similarity index 100%
rename from src/gpu/effects/GrCircleBlurFragmentProcessor.h
rename to src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h
diff --git a/src/gpu/effects/generated/GrCircleEffect.cpp b/src/gpu/effects/generated/GrCircleEffect.cpp
new file mode 100644
index 0000000..f24f2d7
--- /dev/null
+++ b/src/gpu/effects/generated/GrCircleEffect.cpp
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**************************************************************************************************
+ *** This file was autogenerated from GrCircleEffect.fp; do not modify.
+ **************************************************************************************************/
+#include "GrCircleEffect.h"
+#include "glsl/GrGLSLFragmentProcessor.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
+#include "GrTexture.h"
+#include "SkSLCPP.h"
+#include "SkSLUtil.h"
+class GrGLSLCircleEffect : public GrGLSLFragmentProcessor {
+public:
+ GrGLSLCircleEffect() {}
+ void emitCode(EmitArgs& args) override {
+ GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
+ const GrCircleEffect& _outer = args.fFp.cast<GrCircleEffect>();
+ (void)_outer;
+ auto edgeType = _outer.edgeType;
+ (void)edgeType;
+ auto center = _outer.center;
+ (void)center;
+ auto radius = _outer.radius;
+ (void)radius;
+ prevRadius = -1.0;
+ circleVar =
+ args.fUniformHandler->addUniform(kFragment_GrShaderFlag, kHalf4_GrSLType, "circle");
+ fragBuilder->codeAppendf(
+ "half2 prevCenter;\nhalf prevRadius = %f;\nhalf d;\n@if (%d == 2 || %d == 3) {\n "
+ " d = half((length((float2(%s.xy) - sk_FragCoord.xy) * float(%s.w)) - 1.0) * "
+ "float(%s.z));\n} else {\n d = half((1.0 - length((float2(%s.xy) - "
+ "sk_FragCoord.xy) * float(%s.w))) * float(%s.z));\n}\n@if ((%d == 1 || %d == 3) || "
+ "%d == 4) {\n d = clamp(d, 0.0, 1.0);\n} else {\n d = d > 0.5 ? 1.0 : "
+ "0.0;\n}\n%s = %s * d;\n",
+ prevRadius, (int)_outer.edgeType, (int)_outer.edgeType,
+ args.fUniformHandler->getUniformCStr(circleVar),
+ args.fUniformHandler->getUniformCStr(circleVar),
+ args.fUniformHandler->getUniformCStr(circleVar),
+ args.fUniformHandler->getUniformCStr(circleVar),
+ args.fUniformHandler->getUniformCStr(circleVar),
+ args.fUniformHandler->getUniformCStr(circleVar), (int)_outer.edgeType,
+ (int)_outer.edgeType, (int)_outer.edgeType, args.fOutputColor, args.fInputColor);
+ }
+
+private:
+ void onSetData(const GrGLSLProgramDataManager& pdman,
+ const GrFragmentProcessor& _proc) override {
+ const GrCircleEffect& _outer = _proc.cast<GrCircleEffect>();
+ auto edgeType = _outer.edgeType;
+ (void)edgeType;
+ auto center = _outer.center;
+ (void)center;
+ auto radius = _outer.radius;
+ (void)radius;
+ UniformHandle& circle = circleVar;
+ (void)circle;
+
+ if (radius != prevRadius || center != prevCenter) {
+ SkScalar effectiveRadius = radius;
+ if (GrProcessorEdgeTypeIsInverseFill((GrClipEdgeType)edgeType)) {
+ effectiveRadius -= 0.5f;
+ // When the radius is 0.5 effectiveRadius is 0 which causes an inf * 0 in the
+ // shader.
+ effectiveRadius = SkTMax(0.001f, effectiveRadius);
+ } else {
+ effectiveRadius += 0.5f;
+ }
+ pdman.set4f(circle, center.fX, center.fY, effectiveRadius,
+ SkScalarInvert(effectiveRadius));
+ prevCenter = center;
+ prevRadius = radius;
+ }
+ }
+ SkPoint prevCenter = half2(0);
+ float prevRadius = 0;
+ UniformHandle circleVar;
+};
+GrGLSLFragmentProcessor* GrCircleEffect::onCreateGLSLInstance() const {
+ return new GrGLSLCircleEffect();
+}
+void GrCircleEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
+ GrProcessorKeyBuilder* b) const {
+ b->add32((int32_t)edgeType);
+}
+bool GrCircleEffect::onIsEqual(const GrFragmentProcessor& other) const {
+ const GrCircleEffect& that = other.cast<GrCircleEffect>();
+ (void)that;
+ if (edgeType != that.edgeType) return false;
+ if (center != that.center) return false;
+ if (radius != that.radius) return false;
+ return true;
+}
+GrCircleEffect::GrCircleEffect(const GrCircleEffect& src)
+ : INHERITED(kGrCircleEffect_ClassID, src.optimizationFlags())
+ , edgeType(src.edgeType)
+ , center(src.center)
+ , radius(src.radius) {}
+std::unique_ptr<GrFragmentProcessor> GrCircleEffect::clone() const {
+ return std::unique_ptr<GrFragmentProcessor>(new GrCircleEffect(*this));
+}
+GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleEffect);
+#if GR_TEST_UTILS
+std::unique_ptr<GrFragmentProcessor> GrCircleEffect::TestCreate(GrProcessorTestData* testData) {
+ SkPoint center;
+ center.fX = testData->fRandom->nextRangeScalar(0.f, 1000.f);
+ center.fY = testData->fRandom->nextRangeScalar(0.f, 1000.f);
+ SkScalar radius = testData->fRandom->nextRangeF(1.f, 1000.f);
+ GrClipEdgeType et;
+ do {
+ et = (GrClipEdgeType)testData->fRandom->nextULessThan(kGrClipEdgeTypeCnt);
+ } while (GrClipEdgeType::kHairlineAA == et);
+ return GrCircleEffect::Make(et, center, radius);
+}
+#endif
diff --git a/src/gpu/effects/generated/GrCircleEffect.h b/src/gpu/effects/generated/GrCircleEffect.h
new file mode 100644
index 0000000..81ab40e
--- /dev/null
+++ b/src/gpu/effects/generated/GrCircleEffect.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**************************************************************************************************
+ *** This file was autogenerated from GrCircleEffect.fp; do not modify.
+ **************************************************************************************************/
+#ifndef GrCircleEffect_DEFINED
+#define GrCircleEffect_DEFINED
+#include "SkTypes.h"
+#include "GrFragmentProcessor.h"
+#include "GrCoordTransform.h"
+class GrCircleEffect : public GrFragmentProcessor {
+public:
+ static std::unique_ptr<GrFragmentProcessor> Make(GrClipEdgeType edgeType, SkPoint center,
+ float radius) {
+ // A radius below half causes the implicit insetting done by this processor to become
+ // inverted. We could handle this case by making the processor code more complicated.
+ if (radius < .5f && GrProcessorEdgeTypeIsInverseFill(edgeType)) {
+ return nullptr;
+ }
+ return std::unique_ptr<GrFragmentProcessor>(new GrCircleEffect(edgeType, center, radius));
+ }
+ GrCircleEffect(const GrCircleEffect& src);
+ std::unique_ptr<GrFragmentProcessor> clone() const override;
+ const char* name() const override { return "CircleEffect"; }
+ GrClipEdgeType edgeType;
+ SkPoint center;
+ float radius;
+
+private:
+ GrCircleEffect(GrClipEdgeType edgeType, SkPoint center, float radius)
+ : INHERITED(kGrCircleEffect_ClassID,
+ (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag)
+ , edgeType(edgeType)
+ , center(center)
+ , radius(radius) {}
+ GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
+ void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
+ bool onIsEqual(const GrFragmentProcessor&) const override;
+ GR_DECLARE_FRAGMENT_PROCESSOR_TEST
+ typedef GrFragmentProcessor INHERITED;
+};
+#endif
diff --git a/src/gpu/effects/GrComposeLerpEffect.cpp b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrComposeLerpEffect.cpp
rename to src/gpu/effects/generated/GrComposeLerpEffect.cpp
diff --git a/src/gpu/effects/GrComposeLerpEffect.h b/src/gpu/effects/generated/GrComposeLerpEffect.h
similarity index 100%
rename from src/gpu/effects/GrComposeLerpEffect.h
rename to src/gpu/effects/generated/GrComposeLerpEffect.h
diff --git a/src/gpu/effects/GrComposeLerpRedEffect.cpp b/src/gpu/effects/generated/GrComposeLerpRedEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrComposeLerpRedEffect.cpp
rename to src/gpu/effects/generated/GrComposeLerpRedEffect.cpp
diff --git a/src/gpu/effects/GrComposeLerpRedEffect.h b/src/gpu/effects/generated/GrComposeLerpRedEffect.h
similarity index 100%
rename from src/gpu/effects/GrComposeLerpRedEffect.h
rename to src/gpu/effects/generated/GrComposeLerpRedEffect.h
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/generated/GrConfigConversionEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrConfigConversionEffect.cpp
rename to src/gpu/effects/generated/GrConfigConversionEffect.cpp
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/generated/GrConfigConversionEffect.h
similarity index 100%
rename from src/gpu/effects/GrConfigConversionEffect.h
rename to src/gpu/effects/generated/GrConfigConversionEffect.h
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/generated/GrConstColorProcessor.cpp
similarity index 100%
rename from src/gpu/effects/GrConstColorProcessor.cpp
rename to src/gpu/effects/generated/GrConstColorProcessor.cpp
diff --git a/src/gpu/effects/GrConstColorProcessor.h b/src/gpu/effects/generated/GrConstColorProcessor.h
similarity index 100%
rename from src/gpu/effects/GrConstColorProcessor.h
rename to src/gpu/effects/generated/GrConstColorProcessor.h
diff --git a/src/gpu/effects/GrEllipseEffect.cpp b/src/gpu/effects/generated/GrEllipseEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrEllipseEffect.cpp
rename to src/gpu/effects/generated/GrEllipseEffect.cpp
diff --git a/src/gpu/effects/GrEllipseEffect.h b/src/gpu/effects/generated/GrEllipseEffect.h
similarity index 100%
rename from src/gpu/effects/GrEllipseEffect.h
rename to src/gpu/effects/generated/GrEllipseEffect.h
diff --git a/src/gpu/effects/GrLumaColorFilterEffect.cpp b/src/gpu/effects/generated/GrLumaColorFilterEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrLumaColorFilterEffect.cpp
rename to src/gpu/effects/generated/GrLumaColorFilterEffect.cpp
diff --git a/src/gpu/effects/GrLumaColorFilterEffect.h b/src/gpu/effects/generated/GrLumaColorFilterEffect.h
similarity index 100%
rename from src/gpu/effects/GrLumaColorFilterEffect.h
rename to src/gpu/effects/generated/GrLumaColorFilterEffect.h
diff --git a/src/gpu/effects/GrMagnifierEffect.cpp b/src/gpu/effects/generated/GrMagnifierEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrMagnifierEffect.cpp
rename to src/gpu/effects/generated/GrMagnifierEffect.cpp
diff --git a/src/gpu/effects/GrMagnifierEffect.h b/src/gpu/effects/generated/GrMagnifierEffect.h
similarity index 100%
rename from src/gpu/effects/GrMagnifierEffect.h
rename to src/gpu/effects/generated/GrMagnifierEffect.h
diff --git a/src/gpu/effects/GrMixerEffect.cpp b/src/gpu/effects/generated/GrMixerEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrMixerEffect.cpp
rename to src/gpu/effects/generated/GrMixerEffect.cpp
diff --git a/src/gpu/effects/GrMixerEffect.h b/src/gpu/effects/generated/GrMixerEffect.h
similarity index 100%
rename from src/gpu/effects/GrMixerEffect.h
rename to src/gpu/effects/generated/GrMixerEffect.h
diff --git a/src/gpu/effects/GrPremulInputFragmentProcessor.cpp b/src/gpu/effects/generated/GrPremulInputFragmentProcessor.cpp
similarity index 100%
rename from src/gpu/effects/GrPremulInputFragmentProcessor.cpp
rename to src/gpu/effects/generated/GrPremulInputFragmentProcessor.cpp
diff --git a/src/gpu/effects/GrPremulInputFragmentProcessor.h b/src/gpu/effects/generated/GrPremulInputFragmentProcessor.h
similarity index 100%
rename from src/gpu/effects/GrPremulInputFragmentProcessor.h
rename to src/gpu/effects/generated/GrPremulInputFragmentProcessor.h
diff --git a/src/gpu/effects/GrRRectBlurEffect.cpp b/src/gpu/effects/generated/GrRRectBlurEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrRRectBlurEffect.cpp
rename to src/gpu/effects/generated/GrRRectBlurEffect.cpp
diff --git a/src/gpu/effects/GrRRectBlurEffect.h b/src/gpu/effects/generated/GrRRectBlurEffect.h
similarity index 100%
rename from src/gpu/effects/GrRRectBlurEffect.h
rename to src/gpu/effects/generated/GrRRectBlurEffect.h
diff --git a/src/gpu/effects/GrRectBlurEffect.cpp b/src/gpu/effects/generated/GrRectBlurEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrRectBlurEffect.cpp
rename to src/gpu/effects/generated/GrRectBlurEffect.cpp
diff --git a/src/gpu/effects/GrRectBlurEffect.h b/src/gpu/effects/generated/GrRectBlurEffect.h
similarity index 100%
rename from src/gpu/effects/GrRectBlurEffect.h
rename to src/gpu/effects/generated/GrRectBlurEffect.h
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/generated/GrSimpleTextureEffect.cpp
similarity index 100%
rename from src/gpu/effects/GrSimpleTextureEffect.cpp
rename to src/gpu/effects/generated/GrSimpleTextureEffect.cpp
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/generated/GrSimpleTextureEffect.h
similarity index 100%
rename from src/gpu/effects/GrSimpleTextureEffect.h
rename to src/gpu/effects/generated/GrSimpleTextureEffect.h