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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; |
130 continue; | 130 continue; |
131 } | 131 } |
132 | 132 |
133 runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint)); | 133 runPaint.setFlags(FilterTextFlags(fSurfaceProps, runPaint)); |
134 | 134 |
135 GrPaint grPaint; | 135 GrPaint grPaint; |
136 if (!SkPaintToGrPaint(fContext, runPaint, viewMatrix, &grPaint)) { | 136 if (!SkPaintToGrPaint(fContext, runPaint, viewMatrix, &grPaint, rt)) { |
137 return; | 137 return; |
138 } | 138 } |
139 | 139 |
140 switch (it.positioning()) { | 140 switch (it.positioning()) { |
141 case SkTextBlob::kDefault_Positioning: | 141 case SkTextBlob::kDefault_Positioning: |
142 this->drawText(dc, rt, clip, grPaint, runPaint, viewMatrix, (const c
har *)it.glyphs(), | 142 this->drawText(dc, rt, clip, grPaint, runPaint, viewMatrix, (const c
har *)it.glyphs(), |
143 textLen, x + offset.x(), y + offset.y(), clipBounds); | 143 textLen, x + offset.x(), y + offset.y(), clipBounds); |
144 break; | 144 break; |
145 case SkTextBlob::kHorizontal_Positioning: | 145 case SkTextBlob::kHorizontal_Positioning: |
146 this->drawPosText(dc, rt, clip, grPaint, runPaint, viewMatrix, (cons
t char*)it.glyphs(), | 146 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... |
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 } |
OLD | NEW |