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

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

Issue 1411723005: Make SkTextBlob::RunIterator public. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-10-27 (Tuesday) 16:20:53 EDT Created 5 years, 1 month 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/GrTextBlobCache.h ('k') | tests/TextBlobTest.cpp » ('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 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 #include "GrTextContext.h" 8 #include "GrTextContext.h"
9 #include "GrBlurUtils.h" 9 #include "GrBlurUtils.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
11 #include "GrDrawContext.h" 11 #include "GrDrawContext.h"
12 #include "GrFontScaler.h" 12 #include "GrFontScaler.h"
13 13
14 #include "SkAutoKern.h" 14 #include "SkAutoKern.h"
15 #include "SkDrawFilter.h" 15 #include "SkDrawFilter.h"
16 #include "SkDrawProcs.h" 16 #include "SkDrawProcs.h"
17 #include "SkGlyphCache.h" 17 #include "SkGlyphCache.h"
18 #include "SkGpuDevice.h" 18 #include "SkGpuDevice.h"
19 #include "SkGrPriv.h" 19 #include "SkGrPriv.h"
20 #include "SkTextBlob.h" 20 #include "SkTextBlobRunIterator.h"
21 #include "SkTextMapStateProc.h" 21 #include "SkTextMapStateProc.h"
22 #include "SkTextToPathIter.h" 22 #include "SkTextToPathIter.h"
23 23
24 GrTextContext::GrTextContext(GrContext* context, const SkSurfaceProps& surfacePr ops) 24 GrTextContext::GrTextContext(GrContext* context, const SkSurfaceProps& surfacePr ops)
25 : fFallbackTextContext(nullptr) 25 : fFallbackTextContext(nullptr)
26 , fContext(context) 26 , fContext(context)
27 , fSurfaceProps(surfaceProps) { 27 , fSurfaceProps(surfaceProps) {
28 } 28 }
29 29
30 GrTextContext::~GrTextContext() { 30 GrTextContext::~GrTextContext() {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return flags; 109 return flags;
110 } 110 }
111 111
112 void GrTextContext::drawTextBlob(GrDrawContext* dc, GrRenderTarget* rt, 112 void GrTextContext::drawTextBlob(GrDrawContext* dc, GrRenderTarget* rt,
113 const GrClip& clip, const SkPaint& skPaint, 113 const GrClip& clip, const SkPaint& skPaint,
114 const SkMatrix& viewMatrix, const SkTextBlob* b lob, 114 const SkMatrix& viewMatrix, const SkTextBlob* b lob,
115 SkScalar x, SkScalar y, 115 SkScalar x, SkScalar y,
116 SkDrawFilter* drawFilter, const SkIRect& clipBo unds) { 116 SkDrawFilter* drawFilter, const SkIRect& clipBo unds) {
117 SkPaint runPaint = skPaint; 117 SkPaint runPaint = skPaint;
118 118
119 SkTextBlob::RunIterator it(blob); 119 SkTextBlobRunIterator it(blob);
120 for (;!it.done(); it.next()) { 120 for (;!it.done(); it.next()) {
121 size_t textLen = it.glyphCount() * sizeof(uint16_t); 121 size_t textLen = it.glyphCount() * sizeof(uint16_t);
122 const SkPoint& offset = it.offset(); 122 const SkPoint& offset = it.offset();
123 // applyFontToPaint() always overwrites the exact same attributes, 123 // applyFontToPaint() always overwrites the exact same attributes,
124 // so it is safe to not re-seed the paint for this reason. 124 // so it is safe to not re-seed the paint for this reason.
125 it.applyFontToPaint(&runPaint); 125 it.applyFontToPaint(&runPaint);
126 126
127 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) { 127 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) {
128 // A false return from filter() means we should abort the current dr aw. 128 // A false return from filter() means we should abort the current dr aw.
129 runPaint = skPaint; 129 runPaint = skPaint;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { 272 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) {
273 scaler = (GrFontScaler*)auxData; 273 scaler = (GrFontScaler*)auxData;
274 } 274 }
275 if (nullptr == scaler) { 275 if (nullptr == scaler) {
276 scaler = new GrFontScaler(cache); 276 scaler = new GrFontScaler(cache);
277 cache->setAuxProc(GlyphCacheAuxProc, scaler); 277 cache->setAuxProc(GlyphCacheAuxProc, scaler);
278 } 278 }
279 279
280 return scaler; 280 return scaler;
281 } 281 }
OLDNEW
« no previous file with comments | « src/gpu/GrTextBlobCache.h ('k') | tests/TextBlobTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698