OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" | 8 #include "GrStencilAndCoverTextContext.h" |
9 #include "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 | 158 |
159 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) { | 159 if (drawFilter && !drawFilter->filter(&runPaint, SkDrawFilter::kText_Typ e)) { |
160 // A false return from filter() means we should abort the current dr aw. | 160 // A false return from filter() means we should abort the current dr aw. |
161 runPaint = skPaint; | 161 runPaint = skPaint; |
162 continue; | 162 continue; |
163 } | 163 } |
164 | 164 |
165 runPaint.setFlags(GrTextUtils::FilterTextFlags(props, runPaint)); | 165 runPaint.setFlags(GrTextUtils::FilterTextFlags(props, runPaint)); |
166 | 166 |
167 GrPaint grPaint; | 167 GrPaint grPaint; |
168 if (!SkPaintToGrPaint(context, runPaint, viewMatrix, &grPaint)) { | 168 // SRGBTODO: AllowSRGBInputs? (Is the dc here going to be real/correct)? |
bsalomon
2016/04/05 13:24:01
It should be correct.
Brian Osman
2016/04/05 15:36:41
Acknowledged.
| |
169 if (!SkPaintToGrPaint(context, runPaint, viewMatrix, dc->allowSRGBInputs (), &grPaint)) { | |
169 return; | 170 return; |
170 } | 171 } |
171 | 172 |
172 switch (it.positioning()) { | 173 switch (it.positioning()) { |
173 case SkTextBlob::kDefault_Positioning: | 174 case SkTextBlob::kDefault_Positioning: |
174 this->drawText(context, dc, clip, grPaint, runPaint, viewMatrix, props, | 175 this->drawText(context, dc, clip, grPaint, runPaint, viewMatrix, props, |
175 (const char *)it.glyphs(), | 176 (const char *)it.glyphs(), |
176 textLen, x + offset.x(), y + offset.y(), clipBoun ds); | 177 textLen, x + offset.x(), y + offset.y(), clipBoun ds); |
177 break; | 178 break; |
178 case SkTextBlob::kHorizontal_Positioning: | 179 case SkTextBlob::kHorizontal_Positioning: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 } | 214 } |
214 | 215 |
215 if (drawFilter || skPaint.getPathEffect()) { | 216 if (drawFilter || skPaint.getPathEffect()) { |
216 // This draw can't be cached. | 217 // This draw can't be cached. |
217 this->uncachedDrawTextBlob(context, dc, clip, skPaint, viewMatrix, props , skBlob, x, y, | 218 this->uncachedDrawTextBlob(context, dc, clip, skPaint, viewMatrix, props , skBlob, x, y, |
218 drawFilter, clipBounds); | 219 drawFilter, clipBounds); |
219 return; | 220 return; |
220 } | 221 } |
221 | 222 |
222 GrPaint paint; | 223 GrPaint paint; |
223 if (!SkPaintToGrPaint(context, skPaint, viewMatrix, &paint)) { | 224 // SRGBTODO: AllowSRGBInputs? (Is the dc here going to be real/correct)? |
bsalomon
2016/04/05 13:24:01
ditto
Brian Osman
2016/04/05 15:36:41
Acknowledged.
| |
225 if (!SkPaintToGrPaint(context, skPaint, viewMatrix, dc->allowSRGBInputs(), & paint)) { | |
224 return; | 226 return; |
225 } | 227 } |
226 | 228 |
227 const TextBlob& blob = this->findOrCreateTextBlob(skBlob, skPaint); | 229 const TextBlob& blob = this->findOrCreateTextBlob(skBlob, skPaint); |
228 GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget(), clip); | 230 GrPipelineBuilder pipelineBuilder(paint, dc->accessRenderTarget(), clip); |
229 | 231 |
230 TextBlob::Iter iter(blob); | 232 TextBlob::Iter iter(blob); |
231 for (TextRun* run = iter.get(); run; run = iter.next()) { | 233 for (TextRun* run = iter.get(); run; run = iter.next()) { |
232 run->draw(context, dc, &pipelineBuilder, paint.getColor(), viewMatrix, p rops, x, y, | 234 run->draw(context, dc, &pipelineBuilder, paint.getColor(), viewMatrix, p rops, x, y, |
233 clipBounds, fFallbackTextContext, skPaint); | 235 clipBounds, fFallbackTextContext, skPaint); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
699 } | 701 } |
700 | 702 |
701 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) { | 703 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) { |
702 *count = fCount; | 704 *count = fCount; |
703 if (fCount) { | 705 if (fCount) { |
704 this->flush(); | 706 this->flush(); |
705 return fBuilder->build(); | 707 return fBuilder->build(); |
706 } | 708 } |
707 return nullptr; | 709 return nullptr; |
708 } | 710 } |
OLD | NEW |