| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 // have a valid atlas generation | 406 // have a valid atlas generation |
| 407 fFontCache->setUseTokenBulk(*info.bulkUseToken(), target->curren
tToken(), | 407 fFontCache->setUseTokenBulk(*info.bulkUseToken(), target->curren
tToken(), |
| 408 maskFormat); | 408 maskFormat); |
| 409 break; | 409 break; |
| 410 } | 410 } |
| 411 | 411 |
| 412 // now copy all vertices | 412 // now copy all vertices |
| 413 size_t byteCount = info.byteCount(); | 413 size_t byteCount = info.byteCount(); |
| 414 memcpy(currVertex, blob->fVertices + info.vertexStartIndex(), byteCount)
; | 414 memcpy(currVertex, blob->fVertices + info.vertexStartIndex(), byteCount)
; |
| 415 | 415 |
| 416 #ifdef SK_DEBUG | |
| 417 // bounds sanity check | |
| 418 SkRect rect; | |
| 419 rect.setLargestInverted(); | |
| 420 SkPoint* vertex = (SkPoint*) ((char*)blob->fVertices + info.vertexStartI
ndex()); | |
| 421 rect.growToInclude(vertex, vertexStride, kVerticesPerGlyph * info.glyphC
ount()); | |
| 422 | |
| 423 if (this->usesDistanceFields()) { | |
| 424 fBatch.fViewMatrix.mapRect(&rect); | |
| 425 } | |
| 426 SkASSERT(fBounds.contains(rect)); | |
| 427 #endif | |
| 428 | |
| 429 currVertex += byteCount; | 416 currVertex += byteCount; |
| 430 } | 417 } |
| 431 | 418 |
| 432 // Make sure to attach the last cache if applicable | 419 // Make sure to attach the last cache if applicable |
| 433 if (cache) { | 420 if (cache) { |
| 434 SkGlyphCache::AttachCache(cache); | 421 SkGlyphCache::AttachCache(cache); |
| 435 } | 422 } |
| 436 this->flush(target, &flushInfo); | 423 this->flush(target, &flushInfo); |
| 437 } | 424 } |
| 438 | 425 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 return GrDistanceFieldA8TextGeoProc::Create(color, | 547 return GrDistanceFieldA8TextGeoProc::Create(color, |
| 561 viewMatrix, | 548 viewMatrix, |
| 562 texture, | 549 texture, |
| 563 params, | 550 params, |
| 564 flags, | 551 flags, |
| 565 this->usesLocalCoords()); | 552 this->usesLocalCoords()); |
| 566 #endif | 553 #endif |
| 567 } | 554 } |
| 568 | 555 |
| 569 } | 556 } |
| OLD | NEW |