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

Side by Side Diff: src/gpu/GrDefaultGeoProcFactory.h

Issue 1243583002: Add support for transformedLocalCoords to GrDefaultGeoProc (Closed) Base URL: https://skia.googlesource.com/skia.git@pipelinetobatch2
Patch Set: tweaks Created 5 years, 4 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 | « no previous file | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrDefaultGeoProcFactory_DEFINED 8 #ifndef GrDefaultGeoProcFactory_DEFINED
9 #define GrDefaultGeoProcFactory_DEFINED 9 #define GrDefaultGeoProcFactory_DEFINED
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 SkPoint fLocalCoord; 57 SkPoint fLocalCoord;
58 }; 58 };
59 59
60 struct PositionColorLocalCoordCoverage { 60 struct PositionColorLocalCoordCoverage {
61 SkPoint fPosition; 61 SkPoint fPosition;
62 GrColor fColor; 62 GrColor fColor;
63 SkPoint fLocalCoord; 63 SkPoint fLocalCoord;
64 GrColor fCoverage; 64 GrColor fCoverage;
65 }; 65 };
66 66
67 enum GPType {
68 kPosition_GPType = 0x0, // we ALWAYS have position
69 kColor_GPType = 0x01,
70 kLocalCoord_GPType = 0x02,
71 kCoverage_GPType= 0x04,
72 kLastGPType = kCoverage_GPType
73 };
74
75 struct Color { 67 struct Color {
76 enum Type { 68 enum Type {
77 kNone_Type, 69 kNone_Type,
78 kUniform_Type, 70 kUniform_Type,
79 kAttribute_Type, 71 kAttribute_Type,
80 }; 72 };
81 Color(GrColor color) : fType(kUniform_Type), fColor(color) {} 73 Color(GrColor color) : fType(kUniform_Type), fColor(color) {}
82 Color(Type type) : fType(type), fColor(GrColor_ILLEGAL) { 74 Color(Type type) : fType(type), fColor(GrColor_ILLEGAL) {
83 SkASSERT(type != kUniform_Type); 75 SkASSERT(type != kUniform_Type);
84 76
(...skipping 21 matching lines...) Expand all
106 98
107 Type fType; 99 Type fType;
108 uint8_t fCoverage; 100 uint8_t fCoverage;
109 }; 101 };
110 102
111 struct LocalCoords { 103 struct LocalCoords {
112 enum Type { 104 enum Type {
113 kUnused_Type, 105 kUnused_Type,
114 kUsePosition_Type, 106 kUsePosition_Type,
115 kHasExplicit_Type, 107 kHasExplicit_Type,
108 kHasTransformed_Type,
116 }; 109 };
117 LocalCoords(Type type) : fType(type), fMatrix(NULL) {} 110 LocalCoords(Type type) : fType(type), fMatrix(NULL) {}
118 LocalCoords(Type type, const SkMatrix* matrix) : fType(type), fMatrix(ma trix) { 111 LocalCoords(Type type, const SkMatrix* matrix) : fType(type), fMatrix(ma trix) {
119 SkASSERT(kUnused_Type != type); 112 SkASSERT(kUnused_Type != type);
120 } 113 }
121 bool hasLocalMatrix() const { return NULL != fMatrix; } 114 bool hasLocalMatrix() const { return NULL != fMatrix; }
122 115
123 Type fType; 116 Type fType;
124 const SkMatrix* fMatrix; 117 const SkMatrix* fMatrix;
125 }; 118 };
(...skipping 10 matching lines...) Expand all
136 */ 129 */
137 const GrGeometryProcessor* CreateForDeviceSpace(const Color&, 130 const GrGeometryProcessor* CreateForDeviceSpace(const Color&,
138 const Coverage&, 131 const Coverage&,
139 const LocalCoords&, 132 const LocalCoords&,
140 const SkMatrix& viewMatrix); 133 const SkMatrix& viewMatrix);
141 134
142 inline size_t DefaultVertexStride() { return sizeof(PositionAttr); } 135 inline size_t DefaultVertexStride() { return sizeof(PositionAttr); }
143 }; 136 };
144 137
145 #endif 138 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDefaultGeoProcFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698