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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.cpp ('k') | src/gpu/gl/GrGLPathProcessor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrGLPathProcessor_DEFINED
9 #define GrGLPathProcessor_DEFINED
10
11 #include "GrGLPrimitiveProcessor.h"
12
13 class GrPathProcessor;
14 class GrGLPathRendering;
15 class GrGLGpu;
16
17 class GrGLPathProcessor : public GrGLPrimitiveProcessor {
18 public:
19 GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracker&);
20
21 static void GenKey(const GrPathProcessor&,
22 const GrBatchTracker& bt,
23 const GrGLCaps&,
24 GrProcessorKeyBuilder* b);
25
26 void emitCode(EmitArgs&) SK_OVERRIDE;
27
28 virtual void emitTransforms(GrGLGPBuilder*, const TransformsIn&, TransformsO ut*) = 0;
29
30 virtual void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId) {}
31
32 void setData(const GrGLProgramDataManager&,
33 const GrPrimitiveProcessor&,
34 const GrBatchTracker&) SK_OVERRIDE;
35
36 virtual void setTransformData(const GrPrimitiveProcessor&,
37 int index,
38 const SkTArray<const GrCoordTransform*, true>& transforms,
39 GrGLPathRendering*,
40 GrGLuint programID) = 0;
41
42 virtual void didSetData(GrGLPathRendering*) {}
43
44 private:
45 UniformHandle fColorUniform;
46 GrColor fColor;
47
48 typedef GrGLPrimitiveProcessor INHERITED;
49 };
50
51 class GrGLLegacyPathProcessor : public GrGLPathProcessor {
52 public:
53 GrGLLegacyPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke r& bt,
54 int maxTexCoords)
55 : INHERITED(pathProc, bt)
56 , fTexCoordSetCnt(0) {
57 SkDEBUGCODE(fMaxTexCoords = maxTexCoords;)
58 }
59
60 int addTexCoordSets(int count) {
61 int firstFreeCoordSet = fTexCoordSetCnt;
62 fTexCoordSetCnt += count;
63 SkASSERT(fMaxTexCoords >= fTexCoordSetCnt);
64 return firstFreeCoordSet;
65 }
66
67 void emitTransforms(GrGLGPBuilder*, const TransformsIn& tin, TransformsOut* tout) SK_OVERRIDE;
68
69 void setTransformData(const GrPrimitiveProcessor& primProc,
70 int index,
71 const SkTArray<const GrCoordTransform*, true>& transfo rms,
72 GrGLPathRendering* glpr,
73 GrGLuint) SK_OVERRIDE;
74
75 void didSetData(GrGLPathRendering* glpr) SK_OVERRIDE;
76
77 private:
78 SkDEBUGCODE(int fMaxTexCoords;)
79 int fTexCoordSetCnt;
80
81 typedef GrGLPathProcessor INHERITED;
82 };
83
84 class GrGLNormalPathProcessor : public GrGLPathProcessor {
85 public:
86 GrGLNormalPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke r& bt)
87 : INHERITED(pathProc, bt) {}
88
89 void emitTransforms(GrGLGPBuilder* pb, const TransformsIn& tin,TransformsOut * tout) SK_OVERRIDE;
90
91 void resolveSeparableVaryings(GrGLGpu* gpu, GrGLuint programId);
92
93 void setTransformData(const GrPrimitiveProcessor& primProc,
94 int index,
95 const SkTArray<const GrCoordTransform*, true>& coordTr ansforms,
96 GrGLPathRendering* glpr,
97 GrGLuint programID) SK_OVERRIDE;
98
99 private:
100 struct SeparableVaryingInfo {
101 GrSLType fType;
102 GrGLShaderVar fVariable;
103 GrGLint fLocation;
104 };
105
106 typedef SkSTArray<8, SeparableVaryingInfo, true> SeparableVaryingInfoArray;
107
108 SeparableVaryingInfoArray fSeparableVaryingInfos;
109
110 typedef GrGLPathProcessor INHERITED;
111 };
112
113 #endif
OLDNEW
« 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