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

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: Merge issues 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
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrStrokeInfo.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 "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
11 #include "GrDrawTarget.h" 11 #include "GrDrawTarget.h"
12 #include "GrDrawTargetCaps.h" 12 #include "GrDrawTargetCaps.h"
13 #include "GrFontScaler.h" 13 #include "GrFontScaler.h"
14 #include "SkGlyphCache.h" 14 #include "SkGlyphCache.h"
15 #include "GrGpu.h" 15 #include "GrGpu.h"
16 #include "GrIndexBuffer.h" 16 #include "GrIndexBuffer.h"
17 #include "GrStrokeInfo.h"
17 #include "GrTextStrike.h" 18 #include "GrTextStrike.h"
18 #include "GrTextStrike_impl.h" 19 #include "GrTextStrike_impl.h"
19 #include "SkDistanceFieldGen.h" 20 #include "SkDistanceFieldGen.h"
20 #include "SkDraw.h" 21 #include "SkDraw.h"
21 #include "SkGpuDevice.h" 22 #include "SkGpuDevice.h"
22 #include "SkPath.h" 23 #include "SkPath.h"
23 #include "SkRTConf.h" 24 #include "SkRTConf.h"
24 #include "SkStrokeRec.h" 25 #include "SkStrokeRec.h"
25 #include "effects/GrDistanceFieldTextureEffect.h" 26 #include "effects/GrDistanceFieldTextureEffect.h"
26 27
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 268 }
268 glyph->fPath = path; 269 glyph->fPath = path;
269 } 270 }
270 271
271 GrContext::AutoMatrix am; 272 GrContext::AutoMatrix am;
272 SkMatrix ctm; 273 SkMatrix ctm;
273 ctm.setScale(fTextRatio, fTextRatio); 274 ctm.setScale(fTextRatio, fTextRatio);
274 ctm.postTranslate(sx, sy); 275 ctm.postTranslate(sx, sy);
275 GrPaint tmpPaint(fPaint); 276 GrPaint tmpPaint(fPaint);
276 am.setPreConcat(fContext, ctm, &tmpPaint); 277 am.setPreConcat(fContext, ctm, &tmpPaint);
277 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); 278 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);
278 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); 279 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo);
279 return; 280 return;
280 } 281 }
281 282
282 HAS_ATLAS: 283 HAS_ATLAS:
283 SkASSERT(glyph->fPlot); 284 SkASSERT(glyph->fPlot);
284 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); 285 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken();
285 glyph->fPlot->setDrawToken(drawToken); 286 glyph->fPlot->setDrawToken(drawToken);
286 287
287 GrTexture* texture = glyph->fPlot->texture(); 288 GrTexture* texture = glyph->fPlot->texture();
288 SkASSERT(texture); 289 SkASSERT(texture);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift), 569 SkScalarToFixed(x) - (glyph.fAdvanceX >> a lignShift),
569 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift), 570 SkScalarToFixed(y) - (glyph.fAdvanceY >> a lignShift),
570 fontScaler); 571 fontScaler);
571 } 572 }
572 pos += scalarsPerPosition; 573 pos += scalarsPerPosition;
573 } 574 }
574 } 575 }
575 576
576 this->finish(); 577 this->finish();
577 } 578 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrStrokeInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698