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

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: tweaks 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
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.h » ('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 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 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat ||
148 // we don't do text positioning in batch, so we can't quite do that yet. 148 kA565_GrMaskFormat == fMaskFormat;
149 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat;
150 if (hasVertexColor) { 149 if (hasVertexColor) {
151 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType)); 150 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType));
152 } 151 }
153 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", 152 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords",
154 kVec2s_GrVertexAttribTyp e)); 153 kVec2s_GrVertexAttribTyp e));
155 this->addTextureAccess(&fTextureAccess); 154 this->addTextureAccess(&fTextureAccess);
156 } 155 }
157 156
158 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrGLSLCaps& caps, 157 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrGLSLCaps& caps,
159 GrProcessorKeyBuilder* b) const { 158 GrProcessorKeyBuilder* b) const {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 break; 192 break;
194 case 2: 193 case 2:
195 format = kARGB_GrMaskFormat; 194 format = kARGB_GrMaskFormat;
196 break; 195 break;
197 } 196 }
198 197
199 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params, 198 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params,
200 format, GrTest::TestMatrix(d->fRandom), 199 format, GrTest::TestMatrix(d->fRandom),
201 d->fRandom->nextBool()); 200 d->fRandom->nextBool());
202 } 201 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698