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

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

Issue 1605013002: Fix GrAtlasTextBlob bounds management (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext17
Patch Set: fix glprograms Created 4 years, 11 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/batches/GrAtlasTextBatch.h ('k') | src/gpu/text/GrAtlasTextBlob.h » ('j') | 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
416 currVertex += byteCount; 429 currVertex += byteCount;
417 } 430 }
418 431
419 // Make sure to attach the last cache if applicable 432 // Make sure to attach the last cache if applicable
420 if (cache) { 433 if (cache) {
421 SkGlyphCache::AttachCache(cache); 434 SkGlyphCache::AttachCache(cache);
422 } 435 }
423 this->flush(target, &flushInfo); 436 this->flush(target, &flushInfo);
424 } 437 }
425 438
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 return GrDistanceFieldA8TextGeoProc::Create(color, 560 return GrDistanceFieldA8TextGeoProc::Create(color,
548 viewMatrix, 561 viewMatrix,
549 texture, 562 texture,
550 params, 563 params,
551 flags, 564 flags,
552 this->usesLocalCoords()); 565 this->usesLocalCoords());
553 #endif 566 #endif
554 } 567 }
555 568
556 } 569 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.h ('k') | src/gpu/text/GrAtlasTextBlob.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698