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

Side by Side Diff: src/gpu/effects/GrBitmapTextGeoProc.cpp

Issue 1140983002: remove color from GrGeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup2
Patch Set: more Created 5 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 #include "GrBitmapTextGeoProc.h" 8 #include "GrBitmapTextGeoProc.h"
9 #include "GrFontAtlasSizes.h" 9 #include "GrFontAtlasSizes.h"
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 UniformHandle fColorUniform; 112 UniformHandle fColorUniform;
113 113
114 typedef GrGLGeometryProcessor INHERITED; 114 typedef GrGLGeometryProcessor INHERITED;
115 }; 115 };
116 116
117 /////////////////////////////////////////////////////////////////////////////// 117 ///////////////////////////////////////////////////////////////////////////////
118 118
119 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture, 119 GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture,
120 const GrTextureParams& params, GrMaskFo rmat format, 120 const GrTextureParams& params, GrMaskFo rmat format,
121 const SkMatrix& localMatrix) 121 const SkMatrix& localMatrix)
122 : INHERITED(color, SkMatrix::I(), localMatrix) 122 : INHERITED(SkMatrix::I(), localMatrix)
123 , fColor(color)
123 , fTextureAccess(texture, params) 124 , fTextureAccess(texture, params)
124 , fInColor(NULL) 125 , fInColor(NULL)
125 , fMaskFormat(format) { 126 , fMaskFormat(format) {
126 this->initClassID<GrBitmapTextGeoProc>(); 127 this->initClassID<GrBitmapTextGeoProc>();
127 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); 128 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType));
128 129
129 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat; 130 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat;
130 if (hasVertexColor) { 131 if (hasVertexColor) {
131 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType)); 132 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType));
132 } 133 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 format = kA565_GrMaskFormat; 188 format = kA565_GrMaskFormat;
188 break; 189 break;
189 case 2: 190 case 2:
190 format = kARGB_GrMaskFormat; 191 format = kARGB_GrMaskFormat;
191 break; 192 break;
192 } 193 }
193 194
194 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params, 195 return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params,
195 format, GrTest::TestMatrix(random)); 196 format, GrTest::TestMatrix(random));
196 } 197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698