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

Unified Diff: src/gpu/text/GrAtlasTextContext.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrAtlasTextContext.cpp
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index e286aa6d0f8965d818b7101640cda55d5ee9653c..eef4f0bff62e4e5e7d1fdacbc71ef14cee3aa838 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -281,7 +281,7 @@ GrAtlasTextContext::createDrawTextBlob(const GrPaint& paint, const SkPaint& skPa
int glyphCount = skPaint.countText(text, byteLength);
GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
- blob->initThrowawayBlob(viewMatrix);
+ blob->initThrowawayBlob(viewMatrix, x, y);
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
*fContext->caps()->shaderCaps())) {
@@ -304,7 +304,7 @@ GrAtlasTextContext::createDrawPosTextBlob(const GrPaint& paint, const SkPaint& s
int glyphCount = skPaint.countText(text, byteLength);
GrAtlasTextBlob* blob = fCache->createBlob(glyphCount, 1, GrAtlasTextBlob::kGrayTextVASize);
- blob->initThrowawayBlob(viewMatrix);
+ blob->initThrowawayBlob(viewMatrix, offset.x(), offset.y());
if (GrTextUtils::CanDrawAsDistanceFields(skPaint, viewMatrix, fSurfaceProps,
*fContext->caps()->shaderCaps())) {
@@ -393,8 +393,10 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
gTextContext->createDrawTextBlob(grPaint, skPaint, viewMatrix, text,
static_cast<size_t>(textLen), 0, 0));
- SkScalar transX = static_cast<SkScalar>(random->nextU());
- SkScalar transY = static_cast<SkScalar>(random->nextU());
+ // We'd like to be able to test this with random translations, but currently the vertex
+ // bounds and vertices will get out of sync
+ SkScalar transX = 0.f;//SkIntToScalar(random->nextU());
+ SkScalar transY = 0.f;//SkIntToScalar(random->nextU());
return blob->test_createBatch(textLen, 0, 0, color, transX, transY, skPaint,
gSurfaceProps, gTextContext->dfAdjustTable(),
context->getBatchFontCache());
« no previous file with comments | « src/gpu/text/GrAtlasTextBlob.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698