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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 816103003: fix for valgrind (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment typo Created 6 years 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/GrBitmapTextContext.cpp
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index 790590dbcc2c75707cae674aee366f230407bcc3..94b2770b23c6c90c02d67bfd519cd3d26ccda60e 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -154,9 +154,10 @@ void GrBitmapTextContext::onDrawText(const GrPaint& paint, const SkPaint& skPain
SkFixed fx = SkScalarToFixed(x) + halfSampleX;
SkFixed fy = SkScalarToFixed(y) + halfSampleY;
- // if we have RGB, then we won't have any SkShaders so no need to use a localmatrix
- if (kARGB_GrMaskFormat != fCurrMaskFormat && !viewMatrix.invert(&fLocalMatrix)) {
- SkDebugf("Cannot invert viewmatrix\n");
+ // if we have RGB, then we won't have any SkShaders so no need to use a localmatrix, but for
+ // performance reasons we just invert here instead
+ if (!viewMatrix.invert(&fLocalMatrix)) {
+ SkDebugf("Cannot invert viewmatrix\n");
}
while (text < stop) {
@@ -201,11 +202,9 @@ void GrBitmapTextContext::onDrawPosText(const GrPaint& paint, const SkPaint& skP
SkGlyphCache* cache = autoCache.getCache();
GrFontScaler* fontScaler = GetGrFontScaler(cache);
- // store original matrix before we reset, so we can use it to transform positions
- SkMatrix ctm = viewMatrix;
-
- // if we have RGB, then we won't have any SkShaders so no need to use a localmatrix
- if (kARGB_GrMaskFormat != fCurrMaskFormat && !viewMatrix.invert(&fLocalMatrix)) {
+ // if we have RGB, then we won't have any SkShaders so no need to use a localmatrix, but for
+ // performance reasons we just invert here instead
+ if (!viewMatrix.invert(&fLocalMatrix)) {
SkDebugf("Cannot invert viewmatrix\n");
}
@@ -214,12 +213,12 @@ void GrBitmapTextContext::onDrawPosText(const GrPaint& paint, const SkPaint& skP
const char* stop = text + byteLength;
SkTextAlignProc alignProc(fSkPaint.getTextAlign());
- SkTextMapStateProc tmsProc(ctm, offset, scalarsPerPosition);
+ SkTextMapStateProc tmsProc(viewMatrix, offset, scalarsPerPosition);
SkFixed halfSampleX = 0, halfSampleY = 0;
if (cache->isSubpixel()) {
// maybe we should skip the rounding if linearText is set
- SkAxisAlignment baseline = SkComputeAxisAlignmentForHText(ctm);
+ SkAxisAlignment baseline = SkComputeAxisAlignmentForHText(viewMatrix);
SkFixed fxMask = ~0;
SkFixed fyMask = ~0;
« 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