#include "SkGr.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
class AlphaThresholdEffect : public GrFragmentProcessor {
#include "GrProcessor.h"
#include "GrTexture.h"
#include "gl/GrGLCaps.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLProgramDataManager.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "SkGrPixelRef.h"
#include "SkDraw.h"
#include "effects/GrSimpleTextureEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#endif
#include "GrInvariantOutput.h"
#include "GrTexturePriv.h"
#include "SkGr.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#endif
#include "GrInvariantOutput.h"
#include "GrProcessorUnitTest.h"
#include "SkGr.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
namespace {
#if SK_SUPPORT_GPU
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
class ColorMatrixEffect : public GrFragmentProcessor {
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
#include "effects/GrTextureDomain.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#endif
#include "GrInvariantOutput.h"
#include "GrPaint.h"
#include "effects/GrSingleTextureEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
class GrGLDiffuseLightingEffect;
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrInvariantOutput.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#endif
#if SK_SUPPORT_GPU
#include "GrInvariantOutput.h"
#include "effects/GrSingleTextureEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "GrInvariantOutput.h"
#include "GrTexture.h"
#include "effects/Gr1DKernelEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#endif
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
#include "SkGr.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#endif
#include "GrInvariantOutput.h"
#include "SkGr.h"
#include "effects/GrTextureStripAtlas.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
class ColorTableEffect : public GrFragmentProcessor {
#include "GrCoordTransform.h"
#include "GrFragmentProcessor.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
class GrInvariantOutput;
#include "GrBezierEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "GrSingleTextureEffect.h"
#include "GrTextureDomain.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
class GrGLBicubicEffect;
class GrInvariantOutput;
#include "GrFontAtlasSizes.h"
#include "GrInvariantOutput.h"
#include "GrTexture.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "GrInvariantOutput.h"
#include "GrSimpleTextureEffect.h"
#include "SkMatrix.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
class GrGLConfigConversionEffect : public GrGLFragmentProcessor {
*/
#include "effects/GrConstColorProcessor.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
class GLConstColorProcessor : public GrGLFragmentProcessor {
#include "GrConvexPolyEffect.h"
#include "GrInvariantOutput.h"
#include "SkPathPriv.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
//////////////////////////////////////////////////////////////////////////////
*/
#include "GrConvolutionEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "SkXfermode.h"
#include "gl/GrGLCaps.h"
#include "gl/GrGLGpu.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLProgramDataManager.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "glsl/GrGLSLCaps.h"
#include "GrVertexBuffer.h"
#include "SkGr.h"
#include "gl/GrGLGeometryProcessor.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
///////////////////////////////////////////////////////////////////////////////
#include "SkDistanceFieldGen.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/GrGLGeometryProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
#include "SkRect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
//////////////////////////////////////////////////////////////////////////////
* found in the LICENSE file.
*/
#include "GrMatrixConvolutionEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
#include "SkRect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
//////////////////////////////////////////////////////////////////////////////
#include "GrInvariantOutput.h"
#include "GrOvalEffect.h"
#include "SkRRect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
// The effects defined here only handle rrect radii >= kRadiusMin.
#include "GrInvariantOutput.h"
#include "GrTexture.h"
#include "gl/GrGLCaps.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLTexture.h"
#include "gl/builders/GrGLProgramBuilder.h"
#include "GrInvariantOutput.h"
#include "GrSimpleTextureEffect.h"
#include "SkFloatingPoint.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index)
#define GrTextureDomainEffect_DEFINED
#include "GrSingleTextureEffect.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
class GrGLProgramBuilder;
class GrGLShaderBuilder;
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
#include "GrProcessor.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/builders/GrGLProgramBuilder.h"
namespace {
--- /dev/null
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLFragmentProcessor_DEFINED
+#define GrGLFragmentProcessor_DEFINED
+
+#include "GrGLProgramDataManager.h"
+#include "GrGLProcessor.h"
+#include "GrTextureAccess.h"
+
+class GrGLFPBuilder;
+
+class GrGLFragmentProcessor {
+public:
+ GrGLFragmentProcessor() {}
+
+ virtual ~GrGLFragmentProcessor() {}
+
+ typedef GrGLProgramDataManager::UniformHandle UniformHandle;
+ typedef GrGLProcessor::TransformedCoordsArray TransformedCoordsArray;
+ typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray;
+
+ /** Called when the program stage should insert its code into the shaders. The code in each
+ shader will be in its own block ({}) and so locally scoped names will not collide across
+ stages.
+
+ @param builder Interface used to emit code in the shaders.
+ @param processor The processor that generated this program stage.
+ @param key The key that was computed by GenKey() from the generating GrProcessor.
+ @param outputColor A predefined vec4 in the FS in which the stage should place its output
+ color (or coverage).
+ @param inputColor A vec4 that holds the input color to the stage in the FS. This may be
+ NULL in which case the implied input is solid white (all ones).
+ TODO: Better system for communicating optimization info (e.g. input
+ color is solid white, trans black, known to be opaque, etc.) that allows
+ the processor to communicate back similar known info about its output.
+ @param samplers Contains one entry for each GrTextureAccess of the GrProcessor. These
+ can be passed to the builder to emit texture reads in the generated
+ code.
+ TODO this should take a struct
+ */
+ virtual void emitCode(GrGLFPBuilder* builder,
+ const GrFragmentProcessor&,
+ const char* outputColor,
+ const char* inputColor,
+ const TransformedCoordsArray& coords,
+ const TextureSamplerArray& samplers) = 0;
+
+ /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces
+ the same stage key; this function reads data from a GrFragmentProcessor and uploads any
+ uniform variables required by the shaders created in emitCode(). The GrFragmentProcessor
+ parameter is guaranteed to be of the same type that created this GrGLFragmentProcessor and
+ to have an identical processor key as the one that created this GrGLFragmentProcessor. */
+ // TODO update this to pass in GrFragmentProcessor
+ virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) {}
+
+ static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
+
+private:
+ typedef GrGLProcessor INHERITED;
+};
+
+#endif
#include "builders/GrGLProgramBuilder.h"
#include "GrProcessor.h"
-#include "GrGLProcessor.h"
+#include "GrGLFragmentProcessor.h"
#include "GrGLPathRendering.h"
#include "SkRTConf.h"
#include "SkTSearch.h"
typedef SkTArray<TextureSampler> TextureSamplerArray;
};
-class GrGLFPBuilder;
-
-class GrGLFragmentProcessor {
-public:
- GrGLFragmentProcessor() {}
-
- virtual ~GrGLFragmentProcessor() {}
-
- typedef GrGLProgramDataManager::UniformHandle UniformHandle;
- typedef GrGLProcessor::TransformedCoordsArray TransformedCoordsArray;
- typedef GrGLProcessor::TextureSamplerArray TextureSamplerArray;
-
- /** Called when the program stage should insert its code into the shaders. The code in each
- shader will be in its own block ({}) and so locally scoped names will not collide across
- stages.
-
- @param builder Interface used to emit code in the shaders.
- @param processor The processor that generated this program stage.
- @param key The key that was computed by GenKey() from the generating GrProcessor.
- @param outputColor A predefined vec4 in the FS in which the stage should place its output
- color (or coverage).
- @param inputColor A vec4 that holds the input color to the stage in the FS. This may be
- NULL in which case the implied input is solid white (all ones).
- TODO: Better system for communicating optimization info (e.g. input
- color is solid white, trans black, known to be opaque, etc.) that allows
- the processor to communicate back similar known info about its output.
- @param samplers Contains one entry for each GrTextureAccess of the GrProcessor. These
- can be passed to the builder to emit texture reads in the generated
- code.
- TODO this should take a struct
- */
- virtual void emitCode(GrGLFPBuilder* builder,
- const GrFragmentProcessor&,
- const char* outputColor,
- const char* inputColor,
- const TransformedCoordsArray& coords,
- const TextureSamplerArray& samplers) = 0;
-
- /** A GrGLFragmentProcessor instance can be reused with any GrFragmentProcessor that produces
- the same stage key; this function reads data from a GrFragmentProcessor and uploads any
- uniform variables required by the shaders created in emitCode(). The GrFragmentProcessor
- parameter is guaranteed to be of the same type that created this GrGLFragmentProcessor and
- to have an identical processor key as the one that created this GrGLFragmentProcessor. */
- // TODO update this to pass in GrFragmentProcessor
- virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) {}
-
- static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
-
-private:
- typedef GrGLProcessor INHERITED;
-};
-
#endif
*/
#include "GrGLProgramDesc.h"
-#include "GrGLProcessor.h"
+#include "GrGLFragmentProcessor.h"
#include "GrProcessor.h"
#include "GrGLGpu.h"
#include "GrPipeline.h"
#ifndef GrGLXferProcessor_DEFINED
#define GrGLXferProcessor_DEFINED
-#include "GrGLProcessor.h"
+#include "GrGLFragmentProcessor.h"
class GrGLXPBuilder;
class GrXferProcessor;
#define GrGLShaderBuilder_DEFINED
#include "SkTArray.h"
-#include "gl/GrGLProcessor.h"
+#include "gl/GrGLFragmentProcessor.h"
#include "gl/GrGLProgramDesc.h"
#include "gl/GrGLProgramDataManager.h"