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

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

Issue 1514563002: Revert of Allow LCD text to batch across colorchanges. This will always use (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat || 147 // TODO we could think about removing this attribute if color is ignored, bu t unfortunately
148 kA565_GrMaskFormat == fMaskFormat; 148 // we don't do text positioning in batch, so we can't quite do that yet.
149 bool hasVertexColor = kA8_GrMaskFormat == fMaskFormat;
149 if (hasVertexColor) { 150 if (hasVertexColor) {
150 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType)); 151 fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexA ttribType));
151 } 152 }
152 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords", 153 fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords",
153 kVec2s_GrVertexAttribTyp e)); 154 kVec2s_GrVertexAttribTyp e));
154 this->addTextureAccess(&fTextureAccess); 155 this->addTextureAccess(&fTextureAccess);
155 } 156 }
156 157
157 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrGLSLCaps& caps, 158 void GrBitmapTextGeoProc::getGLSLProcessorKey(const GrGLSLCaps& caps,
158 GrProcessorKeyBuilder* b) const { 159 GrProcessorKeyBuilder* b) const {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 break; 193 break;
193 case 2: 194 case 2:
194 format = kARGB_GrMaskFormat; 195 format = kARGB_GrMaskFormat;
195 break; 196 break;
196 } 197 }
197 198
198 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params, 199 return GrBitmapTextGeoProc::Create(GrRandomColor(d->fRandom), d->fTextures[t exIdx], params,
199 format, GrTest::TestMatrix(d->fRandom), 200 format, GrTest::TestMatrix(d->fRandom),
200 d->fRandom->nextBool()); 201 d->fRandom->nextBool());
201 } 202 }
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