| Index: src/gpu/gl/GrGLPrimitiveProcessor.h
|
| diff --git a/src/gpu/gl/GrGLGeometryProcessor.h b/src/gpu/gl/GrGLPrimitiveProcessor.h
|
| similarity index 55%
|
| copy from src/gpu/gl/GrGLGeometryProcessor.h
|
| copy to src/gpu/gl/GrGLPrimitiveProcessor.h
|
| index da6c34731445c4c0dcd45912be8a5c5d18a2f66d..30b1c178cd28ef045c39ef08c383c5f4bfe47e91 100644
|
| --- a/src/gpu/gl/GrGLGeometryProcessor.h
|
| +++ b/src/gpu/gl/GrGLPrimitiveProcessor.h
|
| @@ -5,13 +5,14 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| -#ifndef GrGLGeometryProcessor_DEFINED
|
| -#define GrGLGeometryProcessor_DEFINED
|
| +#ifndef GrGLPrimitiveProcessor_DEFINED
|
| +#define GrGLPrimitiveProcessor_DEFINED
|
|
|
| +#include "GrPrimitiveProcessor.h"
|
| #include "GrGLProcessor.h"
|
|
|
| class GrBatchTracker;
|
| -class GrFragmentProcessor;
|
| +class GrPrimitiveProcessor;
|
| class GrGLGPBuilder;
|
|
|
| class GrGLPrimitiveProcessor {
|
| @@ -81,7 +82,7 @@ protected:
|
| void setupColorPassThrough(GrGLGPBuilder* pb,
|
| GrGPInput inputType,
|
| const char* inputName,
|
| - const GrGeometryProcessor::Attribute* colorAttr,
|
| + const GrPrimitiveProcessor::Attribute* colorAttr,
|
| UniformHandle* colorUniform);
|
|
|
| const char* uViewM() const { return fViewMatrixName; }
|
| @@ -126,103 +127,4 @@ private:
|
| const char* fViewMatrixName;
|
| };
|
|
|
| -class GrGLPathRendering;
|
| -class GrGLVertexBuilder;
|
| -/**
|
| - * If a GL effect needs a GrGLFullShaderBuilder* object to emit vertex code, then it must inherit
|
| - * from this class. Since paths don't have vertices, this class is only meant to be used internally
|
| - * by skia, for special cases.
|
| - */
|
| -class GrGLGeometryProcessor : public GrGLPrimitiveProcessor {
|
| -public:
|
| - /* Any general emit code goes in the base class emitCode. Subclasses override onEmitCode */
|
| - void emitCode(EmitArgs&) SK_OVERRIDE;
|
| -
|
| - void setTransformData(const GrPrimitiveProcessor&,
|
| - const GrGLProgramDataManager&,
|
| - int index,
|
| - const SkTArray<const GrCoordTransform*, true>& transforms);
|
| -
|
| -protected:
|
| - // Many GrGeometryProcessors do not need explicit local coords
|
| - void emitTransforms(GrGLGPBuilder* gp,
|
| - const GrShaderVar& posVar,
|
| - const SkMatrix& localMatrix,
|
| - const TransformsIn& tin,
|
| - TransformsOut* tout) {
|
| - this->emitTransforms(gp, posVar, posVar.c_str(), localMatrix, tin, tout);
|
| - }
|
| -
|
| - void emitTransforms(GrGLGPBuilder*,
|
| - const GrShaderVar& posVar,
|
| - const char* localCoords,
|
| - const SkMatrix& localMatrix,
|
| - const TransformsIn&,
|
| - TransformsOut*);
|
| -
|
| - struct GrGPArgs {
|
| - // The variable used by a GP to store its position. It can be
|
| - // either a vec2 or a vec3 depending on the presence of perspective.
|
| - GrShaderVar fPositionVar;
|
| - };
|
| -
|
| - // Create the correct type of position variable given the CTM
|
| - static void SetupPosition(GrGLVertexBuilder* vsBuilder,
|
| - GrGPArgs* gpArgs,
|
| - const char* posName,
|
| - const SkMatrix& mat,
|
| - const char* matName);
|
| -
|
| - static uint32_t ComputePosKey(const SkMatrix& mat) {
|
| - if (mat.isIdentity()) {
|
| - return 0x0;
|
| - } else if (!mat.hasPerspective()) {
|
| - return 0x01;
|
| - } else {
|
| - return 0x02;
|
| - }
|
| - }
|
| -
|
| -private:
|
| - virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0;
|
| -
|
| - typedef GrGLPrimitiveProcessor INHERITED;
|
| -};
|
| -
|
| -class GrGLGpu;
|
| -
|
| -class GrGLPathProcessor : public GrGLPrimitiveProcessor {
|
| -public:
|
| - GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracker&);
|
| -
|
| - static void GenKey(const GrPathProcessor&,
|
| - const GrBatchTracker& bt,
|
| - const GrGLCaps&,
|
| - GrProcessorKeyBuilder* b);
|
| -
|
| - void emitCode(EmitArgs&) SK_OVERRIDE;
|
| -
|
| - virtual void emitTransforms(GrGLGPBuilder*, const TransformsIn&, TransformsOut*) = 0;
|
| -
|
| - virtual void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId) {}
|
| -
|
| - void setData(const GrGLProgramDataManager&,
|
| - const GrPrimitiveProcessor&,
|
| - const GrBatchTracker&) SK_OVERRIDE;
|
| -
|
| - virtual void setTransformData(const GrPrimitiveProcessor&,
|
| - int index,
|
| - const SkTArray<const GrCoordTransform*, true>& transforms,
|
| - GrGLPathRendering*,
|
| - GrGLuint programID) = 0;
|
| -
|
| - virtual void didSetData(GrGLPathRendering*) {}
|
| -
|
| -private:
|
| - UniformHandle fColorUniform;
|
| - GrColor fColor;
|
| -
|
| - typedef GrGLPrimitiveProcessor INHERITED;
|
| -};
|
| -
|
| #endif
|
|
|