Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: src/gpu/gl/GrGLPathProcessor.h

Issue 920863002: A simple change to move a bunch of stuff out of Gr*Geometry.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clang fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.cpp ('k') | src/gpu/gl/GrGLPathProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPathProcessor.h
diff --git a/src/gpu/gl/GrGLPathProcessor.h b/src/gpu/gl/GrGLPathProcessor.h
new file mode 100644
index 0000000000000000000000000000000000000000..368f1f9fcdf611eb0da0ab62fc75b9b8d043f879
--- /dev/null
+++ b/src/gpu/gl/GrGLPathProcessor.h
@@ -0,0 +1,113 @@
+/*
+ * 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 GrGLPathProcessor_DEFINED
+#define GrGLPathProcessor_DEFINED
+
+#include "GrGLPrimitiveProcessor.h"
+
+class GrPathProcessor;
+class GrGLPathRendering;
+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;
+};
+
+class GrGLLegacyPathProcessor : public GrGLPathProcessor {
+public:
+ GrGLLegacyPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracker& bt,
+ int maxTexCoords)
+ : INHERITED(pathProc, bt)
+ , fTexCoordSetCnt(0) {
+ SkDEBUGCODE(fMaxTexCoords = maxTexCoords;)
+ }
+
+ int addTexCoordSets(int count) {
+ int firstFreeCoordSet = fTexCoordSetCnt;
+ fTexCoordSetCnt += count;
+ SkASSERT(fMaxTexCoords >= fTexCoordSetCnt);
+ return firstFreeCoordSet;
+ }
+
+ void emitTransforms(GrGLGPBuilder*, const TransformsIn& tin, TransformsOut* tout) SK_OVERRIDE;
+
+ void setTransformData(const GrPrimitiveProcessor& primProc,
+ int index,
+ const SkTArray<const GrCoordTransform*, true>& transforms,
+ GrGLPathRendering* glpr,
+ GrGLuint) SK_OVERRIDE;
+
+ void didSetData(GrGLPathRendering* glpr) SK_OVERRIDE;
+
+private:
+ SkDEBUGCODE(int fMaxTexCoords;)
+ int fTexCoordSetCnt;
+
+ typedef GrGLPathProcessor INHERITED;
+};
+
+class GrGLNormalPathProcessor : public GrGLPathProcessor {
+public:
+ GrGLNormalPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracker& bt)
+ : INHERITED(pathProc, bt) {}
+
+ void emitTransforms(GrGLGPBuilder* pb, const TransformsIn& tin,TransformsOut* tout) SK_OVERRIDE;
+
+ void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId);
+
+ void setTransformData(const GrPrimitiveProcessor& primProc,
+ int index,
+ const SkTArray<const GrCoordTransform*, true>& coordTransforms,
+ GrGLPathRendering* glpr,
+ GrGLuint programID) SK_OVERRIDE;
+
+private:
+ struct SeparableVaryingInfo {
+ GrSLType fType;
+ GrGLShaderVar fVariable;
+ GrGLint fLocation;
+ };
+
+ typedef SkSTArray<8, SeparableVaryingInfo, true> SeparableVaryingInfoArray;
+
+ SeparableVaryingInfoArray fSeparableVaryingInfos;
+
+ typedef GrGLPathProcessor INHERITED;
+};
+
+#endif
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.cpp ('k') | src/gpu/gl/GrGLPathProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698