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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 144283004: Add dev bounds to bmp txt context, use bounds to ignore clips (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: cleanup comment Created 6 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 | « src/gpu/GrBitmapTextContext.h ('k') | src/gpu/GrClipMaskManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBitmapTextContext.cpp
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index 79309f3f447b93654940e5621a919aa812b1a36e..4f43c758992e0936220444307c22efb758752ff5 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -39,6 +39,8 @@ GrBitmapTextContext::GrBitmapTextContext(GrContext* context,
fVertices = NULL;
fMaxVertices = 0;
+
+ fVertexBounds.setLargestInverted();
}
GrBitmapTextContext::~GrBitmapTextContext() {
@@ -105,12 +107,13 @@ void GrBitmapTextContext::flushGlyphs() {
fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer());
fDrawTarget->drawIndexedInstances(kTriangles_GrPrimitiveType,
nGlyphs,
- 4, 6);
+ 4, 6, &fVertexBounds);
fDrawTarget->resetVertexSource();
fVertices = NULL;
fMaxVertices = 0;
fCurrVertex = 0;
+ fVertexBounds.setLargestInverted();
SkSafeSetNull(fCurrTexture);
}
}
@@ -616,10 +619,15 @@ HAS_ATLAS:
GrFixed tx = SkIntToFixed(glyph->fAtlasLocation.fX);
GrFixed ty = SkIntToFixed(glyph->fAtlasLocation.fY);
- fVertices[2*fCurrVertex].setRectFan(SkFixedToFloat(vx),
- SkFixedToFloat(vy),
- SkFixedToFloat(vx + width),
- SkFixedToFloat(vy + height),
+ SkRect r;
+ r.fLeft = SkFixedToFloat(vx);
+ r.fTop = SkFixedToFloat(vy);
+ r.fRight = SkFixedToFloat(vx + width);
+ r.fBottom = SkFixedToFloat(vy + height);
+
+ fVertexBounds.growToInclude(r);
+
+ fVertices[2*fCurrVertex].setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom,
2 * sizeof(SkPoint));
fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixedX(tx)),
SkFixedToFloat(texture->normalizeFixedY(ty)),
« no previous file with comments | « src/gpu/GrBitmapTextContext.h ('k') | src/gpu/GrClipMaskManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698