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 "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ
e)) { | 110 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ
e)) { |
111 // A false return from filter() means we should abort the current dr
aw. | 111 // A false return from filter() means we should abort the current dr
aw. |
112 runPaint = skPaint; | 112 runPaint = skPaint; |
113 continue; | 113 continue; |
114 } | 114 } |
115 | 115 |
116 runPaint.setFlags(fGpuDevice->filterTextFlags(runPaint)); | 116 runPaint.setFlags(fGpuDevice->filterTextFlags(runPaint)); |
117 | 117 |
118 GrPaint grPaint; | 118 GrPaint grPaint; |
119 SkPaint2GrPaintShader(fContext, fRenderTarget, runPaint, viewMatrix, tru
e, &grPaint); | 119 if (!SkPaint2GrPaint(fContext, fRenderTarget, runPaint, viewMatrix, true
, &grPaint)) { |
| 120 return; |
| 121 } |
120 | 122 |
121 switch (it.positioning()) { | 123 switch (it.positioning()) { |
122 case SkTextBlob::kDefault_Positioning: | 124 case SkTextBlob::kDefault_Positioning: |
123 this->drawText(rt, clip, grPaint, runPaint, viewMatrix, (const char
*)it.glyphs(), | 125 this->drawText(rt, clip, grPaint, runPaint, viewMatrix, (const char
*)it.glyphs(), |
124 textLen, x + offset.x(), y + offset.y(), clipBounds); | 126 textLen, x + offset.x(), y + offset.y(), clipBounds); |
125 break; | 127 break; |
126 case SkTextBlob::kHorizontal_Positioning: | 128 case SkTextBlob::kHorizontal_Positioning: |
127 this->drawPosText(rt, clip, grPaint, runPaint, viewMatrix, (const ch
ar*)it.glyphs(), | 129 this->drawPosText(rt, clip, grPaint, runPaint, viewMatrix, (const ch
ar*)it.glyphs(), |
128 textLen, it.pos(), 1, SkPoint::Make(x, y + offset.
y()), clipBounds); | 130 textLen, it.pos(), 1, SkPoint::Make(x, y + offset.
y()), clipBounds); |
129 break; | 131 break; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { | 249 if (cache->getAuxProcData(GlyphCacheAuxProc, &auxData)) { |
248 scaler = (GrFontScaler*)auxData; | 250 scaler = (GrFontScaler*)auxData; |
249 } | 251 } |
250 if (NULL == scaler) { | 252 if (NULL == scaler) { |
251 scaler = SkNEW_ARGS(GrFontScaler, (cache)); | 253 scaler = SkNEW_ARGS(GrFontScaler, (cache)); |
252 cache->setAuxProc(GlyphCacheAuxProc, scaler); | 254 cache->setAuxProc(GlyphCacheAuxProc, scaler); |
253 } | 255 } |
254 | 256 |
255 return scaler; | 257 return scaler; |
256 } | 258 } |
OLD | NEW |