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

Side by Side Diff: src/gpu/GrTextContext.cpp

Issue 12379052: Remove constructors from GrVertexAttrib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« src/gpu/GrContext.cpp ('K') | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | 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 2010 Google Inc. 2 * Copyright 2010 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 8
9 9
10 #include "GrTextContext.h" 10 #include "GrTextContext.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 if (fCurrTexture != texture || fCurrVertex + 4 > fMaxVertices) { 183 if (fCurrTexture != texture || fCurrVertex + 4 > fMaxVertices) {
184 this->flushGlyphs(); 184 this->flushGlyphs();
185 fCurrTexture = texture; 185 fCurrTexture = texture;
186 fCurrTexture->ref(); 186 fCurrTexture->ref();
187 } 187 }
188 188
189 if (NULL == fVertices) { 189 if (NULL == fVertices) {
190 // position + texture coord 190 // position + texture coord
191 static const GrVertexAttrib kVertexAttribs[] = { 191 static const GrVertexAttrib kVertexAttribs[] = {
192 GrVertexAttrib(kVec2f_GrVertexAttribType, 0), 192 {kVec2f_GrVertexAttribType, 0},
193 GrVertexAttrib(kVec2f_GrVertexAttribType, sizeof(GrPoint)) 193 {kVec2f_GrVertexAttribType, sizeof(GrPoint)}
194 }; 194 };
195 static const GrAttribBindings kAttribBindings = GrDrawState::ExplicitTex CoordAttribBindingsBit(kGlyphMaskStage); 195 static const GrAttribBindings kAttribBindings = GrDrawState::ExplicitTex CoordAttribBindingsBit(kGlyphMaskStage);
196 196
197 // If we need to reserve vertices allow the draw target to suggest 197 // If we need to reserve vertices allow the draw target to suggest
198 // a number of verts to reserve and whether to perform a flush. 198 // a number of verts to reserve and whether to perform a flush.
199 fMaxVertices = kMinRequestedVerts; 199 fMaxVertices = kMinRequestedVerts;
200 bool flush = false; 200 bool flush = false;
201 fDrawTarget = fContext->getTextTarget(fPaint); 201 fDrawTarget = fContext->getTextTarget(fPaint);
202 if (NULL != fDrawTarget) { 202 if (NULL != fDrawTarget) {
203 fDrawTarget->drawState()->setVertexAttribs(kVertexAttribs, SK_ARRAY_ COUNT(kVertexAttribs)); 203 fDrawTarget->drawState()->setVertexAttribs(kVertexAttribs, SK_ARRAY_ COUNT(kVertexAttribs));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 SkFixedToFloat(vx + width), 241 SkFixedToFloat(vx + width),
242 SkFixedToFloat(vy + height), 242 SkFixedToFloat(vy + height),
243 2 * sizeof(SkPoint)); 243 2 * sizeof(SkPoint));
244 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)), 244 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)),
245 SkFixedToFloat(texture->normalizeFixed Y(ty)), 245 SkFixedToFloat(texture->normalizeFixed Y(ty)),
246 SkFixedToFloat(texture->normalizeFixed X(tx + width)), 246 SkFixedToFloat(texture->normalizeFixed X(tx + width)),
247 SkFixedToFloat(texture->normalizeFixed Y(ty + height)), 247 SkFixedToFloat(texture->normalizeFixed Y(ty + height)),
248 2 * sizeof(SkPoint)); 248 2 * sizeof(SkPoint));
249 fCurrVertex += 4; 249 fCurrVertex += 4;
250 } 250 }
OLDNEW
« src/gpu/GrContext.cpp ('K') | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698