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

Unified Diff: src/gpu/text/GrAtlasTextContext.cpp

Issue 1730253002: fixup GLPrograms textblob todo (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fix comment Created 4 years, 10 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 | « no previous file | 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 1934a8dc57068ec09f57730f00ed581b904e3a6f..9cdd891b15bf5bbd44a935f361bb77bd29a26281 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -389,9 +389,15 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
const char* text = "The quick brown fox jumps over the lazy dog.";
int textLen = (int)strlen(text);
- // Setup clip
- GrClip clip;
-
+ // create some random x/y offsets, including negative offsets
+ static const int kMaxTrans = 1024;
+ int xPos = (random->nextU() % 2) * 2 - 1;
+ int yPos = (random->nextU() % 2) * 2 - 1;
+ int xInt = (random->nextU() % kMaxTrans) * xPos;
+ int yInt = (random->nextU() % kMaxTrans) * yPos;
+ SkScalar x = SkIntToScalar(xInt);
+ SkScalar y = SkIntToScalar(yInt);
+
// right now we don't handle textblobs, nor do we handle drawPosText. Since we only
// intend to test the batch with this unit test, that is okay.
SkAutoTUnref<GrAtlasTextBlob> blob(
@@ -400,12 +406,8 @@ DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
*context->caps()->shaderCaps(), grPaint, skPaint,
viewMatrix,
gSurfaceProps, text,
- static_cast<size_t>(textLen), 0, 0));
+ static_cast<size_t>(textLen), x, y));
- // 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 x = 0.f;//SkIntToScalar(random->nextU());
- SkScalar y = 0.f;//SkIntToScalar(random->nextU());
return blob->test_createBatch(textLen, 0, 0, viewMatrix, x, y, color, skPaint,
gSurfaceProps, gTextContext->dfAdjustTable(),
context->getBatchFontCache());
« 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