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

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

Issue 1266003002: Modifying TextBlobCacheTest to use SkRandomScalerContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks 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 | « src/fonts/SkRandomScalerContext.cpp ('k') | src/gpu/GrBatchAtlas.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 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 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 GrGlyph::PackedID id = glyph->fPackedID; 1671 GrGlyph::PackedID id = glyph->fPackedID;
1672 const SkGlyph& skGlyph = scaler->grToSkGlyph(id); 1672 const SkGlyph& skGlyph = scaler->grToSkGlyph(id);
1673 if (regenerateGlyphs) { 1673 if (regenerateGlyphs) {
1674 // Get the id from the old glyph, and use the new st rike to lookup 1674 // Get the id from the old glyph, and use the new st rike to lookup
1675 // the glyph. 1675 // the glyph.
1676 blob->fGlyphs[glyphOffset] = strike->getGlyph(skGlyp h, id, maskFormat, 1676 blob->fGlyphs[glyphOffset] = strike->getGlyph(skGlyp h, id, maskFormat,
1677 scaler ); 1677 scaler );
1678 } 1678 }
1679 glyph = blob->fGlyphs[glyphOffset]; 1679 glyph = blob->fGlyphs[glyphOffset];
1680 SkASSERT(glyph); 1680 SkASSERT(glyph);
1681 SkASSERT(id == glyph->fPackedID && 1681 SkASSERT(id == glyph->fPackedID);
1682 glyph->fMaskFormat == this->maskFormat()); 1682 // We want to be able to assert this but cannot for test ing purposes.
1683 // once skbug:4143 has landed we can revist this assert
1684 //SkASSERT(glyph->fMaskFormat == this->maskFormat());
1683 1685
1684 if (!fFontCache->hasGlyph(glyph) && 1686 if (!fFontCache->hasGlyph(glyph) &&
1685 !strike->addGlyphToAtlas(batchTarget, glyph, scaler, skGlyph, 1687 !strike->addGlyphToAtlas(batchTarget, glyph, scaler, skGlyph,
1686 maskFormat)) { 1688 maskFormat)) {
1687 this->flush(batchTarget, &flushInfo); 1689 this->flush(batchTarget, &flushInfo);
1688 batchTarget->initDraw(gp, pipeline); 1690 batchTarget->initDraw(gp, pipeline);
1689 brokenRun = glyphIdx > 0; 1691 brokenRun = glyphIdx > 0;
1690 1692
1691 SkDEBUGCODE(bool success =) strike->addGlyphToAtlas( batchTarget, 1693 SkDEBUGCODE(bool success =) strike->addGlyphToAtlas( batchTarget,
1692 glyph, 1694 glyph,
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2277 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2276 static_cast<size_t>(textLen), 0, 0, noClip)); 2278 static_cast<size_t>(textLen), 0, 0, noClip));
2277 2279
2278 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2280 SkScalar transX = static_cast<SkScalar>(random->nextU());
2279 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2281 SkScalar transY = static_cast<SkScalar>(random->nextU());
2280 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ; 2282 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ;
2281 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2283 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2282 } 2284 }
2283 2285
2284 #endif 2286 #endif
OLDNEW
« no previous file with comments | « src/fonts/SkRandomScalerContext.cpp ('k') | src/gpu/GrBatchAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698