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

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

Issue 1252423002: fix for GrAtlasTextContext occasionally crashes on mixed runs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | 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 2015 Google Inc. 2 * Copyright 2015 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 #include "GrAtlasTextContext.h" 7 #include "GrAtlasTextContext.h"
8 8
9 #include "GrBatch.h" 9 #include "GrBatch.h"
10 #include "GrBatchFontCache.h" 10 #include "GrBatchFontCache.h"
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 // If the glyph is too large we fall back to paths 1275 // If the glyph is too large we fall back to paths
1276 if (glyph->fTooLargeForAtlas) { 1276 if (glyph->fTooLargeForAtlas) {
1277 this->appendGlyphPath(blob, glyph, scaler, SkIntToScalar(vx), SkIntToSca lar(vy)); 1277 this->appendGlyphPath(blob, glyph, scaler, SkIntToScalar(vx), SkIntToSca lar(vy));
1278 return; 1278 return;
1279 } 1279 }
1280 1280
1281 GrMaskFormat format = glyph->fMaskFormat; 1281 GrMaskFormat format = glyph->fMaskFormat;
1282 1282
1283 PerSubRunInfo* subRun = &run.fSubRunInfo.back(); 1283 PerSubRunInfo* subRun = &run.fSubRunInfo.back();
1284 if (run.fInitialized && subRun->fMaskFormat != format) { 1284 if (run.fInitialized && subRun->fMaskFormat != format) {
1285 subRun = &run.fSubRunInfo.push_back(); 1285 subRun = &run.push_back();
1286 } 1286 }
1287 1287
1288 run.fInitialized = true; 1288 run.fInitialized = true;
1289 1289
1290 size_t vertexStride = get_vertex_stride(format); 1290 size_t vertexStride = get_vertex_stride(format);
1291 1291
1292 SkRect r; 1292 SkRect r;
1293 r.fLeft = SkIntToScalar(x); 1293 r.fLeft = SkIntToScalar(x);
1294 r.fTop = SkIntToScalar(y); 1294 r.fTop = SkIntToScalar(y);
1295 r.fRight = r.fLeft + SkIntToScalar(width); 1295 r.fRight = r.fLeft + SkIntToScalar(width);
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
2291 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2291 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2292 static_cast<size_t>(textLen), 0, 0, noClip)); 2292 static_cast<size_t>(textLen), 0, 0, noClip));
2293 2293
2294 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2294 SkScalar transX = static_cast<SkScalar>(random->nextU());
2295 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2295 SkScalar transY = static_cast<SkScalar>(random->nextU());
2296 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ; 2296 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ;
2297 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2297 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2298 } 2298 }
2299 2299
2300 #endif 2300 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698