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

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

Issue 1502253003: Allow LCD text to batch across colorchanges. This will always use (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: a bit more cleanup Created 5 years 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 "GrInvariantOutput.h" 9 #include "GrInvariantOutput.h"
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 const SkMatrix& localMatrix, bool usesL ocalCoords) 137 const SkMatrix& localMatrix, bool usesL ocalCoords)
138 : fColor(color) 138 : fColor(color)
139 , fLocalMatrix(localMatrix) 139 , fLocalMatrix(localMatrix)
140 , fUsesLocalCoords(usesLocalCoords) 140 , fUsesLocalCoords(usesLocalCoords)
141 , fTextureAccess(texture, params) 141 , fTextureAccess(texture, params)
142 , fInColor(nullptr) 142 , fInColor(nullptr)
143 , fMaskFormat(format) { 143 , fMaskFormat(format) {
144 this->initClassID<GrBitmapTextGeoProc>(); 144 this->initClassID<GrBitmapTextGeoProc>();
145 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); 145 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType));
146 146
147 // TODO we could think about removing this attribute if color is ignored, bu t unfortunately 147 // TODO we could think about removing this attribute if color is ignored, bu t unfortunately
bsalomon 2015/12/08 16:27:13 Are we really every going to do this? Seems like w
joshualitt 2015/12/08 17:04:37 Given infinite time and infinite resources...okay
148 // we don't do text positioning in batch, so we can't quite do that yet. 148 // we don't do text positioning in batch, so we can't quite do that yet.
149 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat; 149 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat ||
150 kA565_GrMaskFormat == fMaskFormat;
150 if (hasVertexColor) { 151 if (hasVertexColor) {
151 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType)); 152 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType));
152 } 153 }
153 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", 154 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords",
154 kVec2s_GrVertexAttribTyp e)); 155 kVec2s_GrVertexAttribTyp e));
155 this->addTextureAccess(&fTextureAccess); 156 this->addTextureAccess(&fTextureAccess);
156 } 157 }
157 158
158 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrGLSLCaps& caps, 159 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrGLSLCaps& caps,
159 GrProcessorKeyBuilder* b) const { 160 GrProcessorKeyBuilder* b) const {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 break; 194 break;
194 case 2: 195 case 2:
195 format = kARGB_GrMaskFormat; 196 format = kARGB_GrMaskFormat;
196 break; 197 break;
197 } 198 }
198 199
199 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params, 200 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params,
200 format, GrTest::TestMatrix(d->fRandom), 201 format, GrTest::TestMatrix(d->fRandom),
201 d->fRandom->nextBool()); 202 d->fRandom->nextBool());
202 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698