| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |