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

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

Issue 1089063002: Don't draw if SkShader::asNewFragmentProcessor fails. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix crash in pipe Created 5 years, 8 months 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/GrAtlasTextContext.cpp ('k') | src/gpu/SkGpuDevice.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 "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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698