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

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

Issue 311183002: Push dash checks into GrContext. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix merge issue with bounder Created 6 years, 6 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 "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
11 #include "GrDrawTargetCaps.h" 11 #include "GrDrawTargetCaps.h"
12 #include "GrFontScaler.h" 12 #include "GrFontScaler.h"
13 #include "SkGlyphCache.h" 13 #include "SkGlyphCache.h"
14 #include "GrIndexBuffer.h" 14 #include "GrIndexBuffer.h"
15 #include "GrPaintStyle.h"
15 #include "GrTextStrike.h" 16 #include "GrTextStrike.h"
16 #include "GrTextStrike_impl.h" 17 #include "GrTextStrike_impl.h"
17 #include "SkDistanceFieldGen.h" 18 #include "SkDistanceFieldGen.h"
18 #include "SkDraw.h" 19 #include "SkDraw.h"
19 #include "SkGpuDevice.h" 20 #include "SkGpuDevice.h"
20 #include "SkPath.h" 21 #include "SkPath.h"
21 #include "SkRTConf.h" 22 #include "SkRTConf.h"
22 #include "SkStrokeRec.h" 23 #include "SkStrokeRec.h"
23 #include "effects/GrDistanceFieldTextureEffect.h" 24 #include "effects/GrDistanceFieldTextureEffect.h"
24 25
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 241 }
241 glyph->fPath = path; 242 glyph->fPath = path;
242 } 243 }
243 244
244 GrContext::AutoMatrix am; 245 GrContext::AutoMatrix am;
245 SkMatrix ctm; 246 SkMatrix ctm;
246 ctm.setScale(fTextRatio, fTextRatio); 247 ctm.setScale(fTextRatio, fTextRatio);
247 ctm.postTranslate(sx, sy); 248 ctm.postTranslate(sx, sy);
248 GrPaint tmpPaint(fPaint); 249 GrPaint tmpPaint(fPaint);
249 am.setPreConcat(fContext, ctm, &tmpPaint); 250 am.setPreConcat(fContext, ctm, &tmpPaint);
251 GrPaintStyle style;
250 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); 252 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle);
251 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); 253 style.setStrokeRec(&stroke);
254 fContext->drawPath(tmpPaint, *glyph->fPath, style);
252 return; 255 return;
253 } 256 }
254 257
255 HAS_ATLAS: 258 HAS_ATLAS:
256 SkASSERT(glyph->fPlot); 259 SkASSERT(glyph->fPlot);
257 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); 260 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken();
258 glyph->fPlot->setDrawToken(drawToken); 261 glyph->fPlot->setDrawToken(drawToken);
259 262
260 GrTexture* texture = glyph->fPlot->texture(); 263 GrTexture* texture = glyph->fPlot->texture();
261 SkASSERT(texture); 264 SkASSERT(texture);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift), 498 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift),
496 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift), 499 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift),
497 fontScaler); 500 fontScaler);
498 } 501 }
499 pos += scalarsPerPosition; 502 pos += scalarsPerPosition;
500 } 503 }
501 } 504 }
502 505
503 this->finish(); 506 this->finish();
504 } 507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698