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

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

Issue 1103243002: fix a bug in scrolling BitmapText gpu cached textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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') | 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 7
8 #include "GrTextBlobCache.h" 8 #include "GrTextBlobCache.h"
9 9
10 static const int kVerticesPerGlyph = 4; 10 static const int kVerticesPerGlyph = 4;
(...skipping 18 matching lines...) Expand all
29 cacheBlob->fVertices = sizeof(BitmapTextBlob) + reinterpret_cast<unsigned ch ar*>(cacheBlob); 29 cacheBlob->fVertices = sizeof(BitmapTextBlob) + reinterpret_cast<unsigned ch ar*>(cacheBlob);
30 cacheBlob->fGlyphs = reinterpret_cast<GrGlyph**>(cacheBlob->fVertices + vert icesCount); 30 cacheBlob->fGlyphs = reinterpret_cast<GrGlyph**>(cacheBlob->fVertices + vert icesCount);
31 cacheBlob->fRuns = reinterpret_cast<BitmapTextBlob::Run*>(cacheBlob->fGlyphs + glyphCount); 31 cacheBlob->fRuns = reinterpret_cast<BitmapTextBlob::Run*>(cacheBlob->fGlyphs + glyphCount);
32 32
33 // Initialize runs 33 // Initialize runs
34 for (int i = 0; i < runCount; i++) { 34 for (int i = 0; i < runCount; i++) {
35 SkNEW_PLACEMENT(&cacheBlob->fRuns[i], BitmapTextBlob::Run); 35 SkNEW_PLACEMENT(&cacheBlob->fRuns[i], BitmapTextBlob::Run);
36 } 36 }
37 cacheBlob->fRunCount = runCount; 37 cacheBlob->fRunCount = runCount;
38 cacheBlob->fPool = &fPool; 38 cacheBlob->fPool = &fPool;
39
40 #ifdef SK_DEBUG
41 cacheBlob->fTotalXError = 0;
42 cacheBlob->fTotalYError = 0;
43 #endif
44 return cacheBlob; 39 return cacheBlob;
45 } 40 }
46 41
47 void GrTextBlobCache::freeAll() { 42 void GrTextBlobCache::freeAll() {
48 SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key>::Iter iter(&fCache); 43 SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key>::Iter iter(&fCache);
49 while (!iter.done()) { 44 while (!iter.done()) {
50 (&(*iter))->unref(); 45 (&(*iter))->unref();
51 ++iter; 46 ++iter;
52 } 47 }
53 fCache.rewind(); 48 fCache.rewind();
54 } 49 }
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698