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

Side by Side Diff: src/gpu/GrAtlasTextBlob.h

Issue 1256763005: Fix for GrAtlasTextContext crash (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: feedback inc 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 7
8 #ifndef GrAtlasTextBlob_DEFINED 8 #ifndef GrAtlasTextBlob_DEFINED
9 #define GrAtlasTextBlob_DEFINED 9 #define GrAtlasTextBlob_DEFINED
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 uint32_t fGlyphStartIndex; 92 uint32_t fGlyphStartIndex;
93 uint32_t fGlyphEndIndex; 93 uint32_t fGlyphEndIndex;
94 SkScalar fTextRatio; // df property 94 SkScalar fTextRatio; // df property
95 GrMaskFormat fMaskFormat; 95 GrMaskFormat fMaskFormat;
96 bool fDrawAsDistanceFields; // df property 96 bool fDrawAsDistanceFields; // df property
97 bool fUseLCDText; // df property 97 bool fUseLCDText; // df property
98 }; 98 };
99 99
100 SubRunInfo& push_back() { 100 SubRunInfo& push_back() {
101 // Forward glyph / vertex information to seed the new sub run 101 // Forward glyph / vertex information to seed the new sub run
102 SubRunInfo& prevSubRun = fSubRunInfo.back();
103 SubRunInfo& newSubRun = fSubRunInfo.push_back(); 102 SubRunInfo& newSubRun = fSubRunInfo.push_back();
103 SubRunInfo& prevSubRun = fSubRunInfo.fromBack(1);
104
104 newSubRun.fGlyphStartIndex = prevSubRun.fGlyphEndIndex; 105 newSubRun.fGlyphStartIndex = prevSubRun.fGlyphEndIndex;
105 newSubRun.fGlyphEndIndex = prevSubRun.fGlyphEndIndex; 106 newSubRun.fGlyphEndIndex = prevSubRun.fGlyphEndIndex;
106 107
107 newSubRun.fVertexStartIndex = prevSubRun.fVertexEndIndex; 108 newSubRun.fVertexStartIndex = prevSubRun.fVertexEndIndex;
108 newSubRun.fVertexEndIndex = prevSubRun.fVertexEndIndex; 109 newSubRun.fVertexEndIndex = prevSubRun.fVertexEndIndex;
109 return newSubRun; 110 return newSubRun;
110 } 111 }
111 static const int kMinSubRuns = 1; 112 static const int kMinSubRuns = 1;
112 SkAutoTUnref<GrBatchTextStrike> fStrike; 113 SkAutoTUnref<GrBatchTextStrike> fStrike;
113 SkAutoTUnref<SkTypeface> fTypeface; 114 SkAutoTUnref<SkTypeface> fTypeface;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; } 221 void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; }
221 void setHasBitmap() { fTextType |= kHasBitmap_TextType; } 222 void setHasBitmap() { fTextType |= kHasBitmap_TextType; }
222 223
223 #ifdef CACHE_SANITY_CHECK 224 #ifdef CACHE_SANITY_CHECK
224 static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&); 225 static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&);
225 size_t fSize; 226 size_t fSize;
226 #endif 227 #endif
227 }; 228 };
228 229
229 #endif 230 #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