OLD | NEW |
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" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ
e)) { | 124 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ
e)) { |
125 // A false return from filter() means we should abort the current dr
aw. | 125 // A false return from filter() means we should abort the current dr
aw. |
126 runPaint = skPaint; | 126 runPaint = skPaint; |
127 continue; | 127 continue; |
128 } | 128 } |
129 | 129 |
130 runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint)); | 130 runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint)); |
131 | 131 |
132 GrPaint grPaint; | 132 GrPaint grPaint; |
133 if (!SkPaint2GrPaint(fContext, rt, runPaint, viewMatrix, true, &grPaint)
) { | 133 if (!SkPaint2GrPaint(fContext, runPaint, viewMatrix, true, &grPaint)) { |
134 return; | 134 return; |
135 } | 135 } |
136 | 136 |
137 switch (it.positioning()) { | 137 switch (it.positioning()) { |
138 case SkTextBlob::kDefault_Positioning: | 138 case SkTextBlob::kDefault_Positioning: |
139 this->drawText(dc, rt, clip, grPaint, runPaint, viewMatrix, (const c
har *)it.glyphs(), | 139 this->drawText(dc, rt, clip, grPaint, runPaint, viewMatrix, (const c
har *)it.glyphs(), |
140 textLen, x + offset.x(), y + offset.y(), clipBounds); | 140 textLen, x + offset.x(), y + offset.y(), clipBounds); |
141 break; | 141 break; |
142 case SkTextBlob::kHorizontal_Positioning: | 142 case SkTextBlob::kHorizontal_Positioning: |
143 this->drawPosText(dc, rt, clip, grPaint, runPaint, viewMatrix, (cons
t char*)it.glyphs(), | 143 this->drawPosText(dc, rt, clip, grPaint, runPaint, viewMatrix, (cons
t char*)it.glyphs(), |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { | 269 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { |
270 scaler = (GrFontScaler*)auxData; | 270 scaler = (GrFontScaler*)auxData; |
271 } | 271 } |
272 if (nullptr == scaler) { | 272 if (nullptr == scaler) { |
273 scaler = new GrFontScaler(cache); | 273 scaler = new GrFontScaler(cache); |
274 cache->setAuxProc(GlyphCacheAuxProc, scaler); | 274 cache->setAuxProc(GlyphCacheAuxProc, scaler); |
275 } | 275 } |
276 | 276 |
277 return scaler; | 277 return scaler; |
278 } | 278 } |
OLD | NEW |