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

Side by Side Diff: src/gpu/batches/GrAtlasTextBatch.cpp

Issue 1882833002: Allow a small tolerance in GrAtlasTextBatch bounds test. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: speeling Created 4 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 | « 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 #include "GrAtlasTextBatch.h" 8 #include "GrAtlasTextBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 #ifdef SK_DEBUG 157 #ifdef SK_DEBUG
158 // bounds sanity check 158 // bounds sanity check
159 SkRect rect; 159 SkRect rect;
160 rect.setLargestInverted(); 160 rect.setLargestInverted();
161 SkPoint* vertex = (SkPoint*) ((char*)blobVertices); 161 SkPoint* vertex = (SkPoint*) ((char*)blobVertices);
162 rect.growToInclude(vertex, vertexStride, kVerticesPerGlyph * subRunGlyph Count); 162 rect.growToInclude(vertex, vertexStride, kVerticesPerGlyph * subRunGlyph Count);
163 163
164 if (this->usesDistanceFields()) { 164 if (this->usesDistanceFields()) {
165 args.fViewMatrix.mapRect(&rect); 165 args.fViewMatrix.mapRect(&rect);
166 } 166 }
167 SkASSERT(fBounds.contains(rect)); 167 // Allow for small numerical error in the bounds.
168 SkRect bounds = fBounds;
169 bounds.outset(0.001f, 0.001f);
170 SkASSERT(bounds.contains(rect));
168 #endif 171 #endif
169 172
170 currVertex += byteCount; 173 currVertex += byteCount;
171 } 174 }
172 175
173 // Make sure to attach the last cache if applicable 176 // Make sure to attach the last cache if applicable
174 if (cache) { 177 if (cache) {
175 SkGlyphCache::AttachCache(cache); 178 SkGlyphCache::AttachCache(cache);
176 } 179 }
177 this->flush(target, &flushInfo); 180 this->flush(target, &flushInfo);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 flags, 311 flags,
309 this->usesLocalCoords()); 312 this->usesLocalCoords());
310 #endif 313 #endif
311 } 314 }
312 315
313 } 316 }
314 317
315 void GrBlobRegenHelper::flush() { 318 void GrBlobRegenHelper::flush() {
316 fBatch->flush(fTarget, fFlushInfo); 319 fBatch->flush(fTarget, fFlushInfo);
317 } 320 }
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