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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 817853002: Remove localcoordchange functions off paint (Closed) Base URL: https://skia.googlesource.com/skia.git@local-matrix-on-gp
Patch Set: changing ignores 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 | « src/gpu/GrBitmapTextContext.h ('k') | src/gpu/GrClipMaskManager.cpp » ('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 732a514c4fb2ef38983d69059afa68328ffb0b2b..790590dbcc2c75707cae674aee366f230407bcc3 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -154,7 +154,8 @@ void GrBitmapTextContext::onDrawText(const GrPaint& paint, const SkPaint& skPain
SkFixed fx = SkScalarToFixed(x) + halfSampleX;
SkFixed fy = SkScalarToFixed(y) + halfSampleY;
- if (!fPaint.localCoordChangeInverse(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)) {
SkDebugf("Cannot invert viewmatrix\n");
}
@@ -202,7 +203,9 @@ void GrBitmapTextContext::onDrawPosText(const GrPaint& paint, const SkPaint& skP
// store original matrix before we reset, so we can use it to transform positions
SkMatrix ctm = viewMatrix;
- if (!fPaint.localCoordChangeInverse(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)) {
SkDebugf("Cannot invert viewmatrix\n");
}
@@ -559,7 +562,6 @@ void GrBitmapTextContext::flush() {
}
GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kNone_FilterMode);
- // TODO cache these GPs
if (kARGB_GrMaskFormat == fCurrMaskFormat) {
uint32_t textureUniqueID = fCurrTexture->getUniqueID();
if (textureUniqueID != fEffectTextureUniqueID ||
@@ -569,19 +571,22 @@ void GrBitmapTextContext::flush() {
fCachedTextureProcessor.reset(GrSimpleTextureEffect::Create(fCurrTexture,
SkMatrix::I(),
params));
+ fEffectTextureUniqueID = textureUniqueID;
}
drawState.addColorProcessor(fCachedTextureProcessor.get());
} else {
uint32_t textureUniqueID = fCurrTexture->getUniqueID();
if (textureUniqueID != fEffectTextureUniqueID ||
- fCachedGeometryProcessor->color() != color) {
+ fCachedGeometryProcessor->color() != color ||
+ !fCachedGeometryProcessor->localMatrix().cheapEqualTo(fLocalMatrix)) {
bool hasColor = kA8_GrMaskFormat == fCurrMaskFormat;
bool opaqueVertexColors = GrColorIsOpaque(fPaint.getColor());
fCachedGeometryProcessor.reset(GrBitmapTextGeoProc::Create(color,
fCurrTexture,
params,
hasColor,
- opaqueVertexColors));
+ opaqueVertexColors,
+ fLocalMatrix));
fEffectTextureUniqueID = textureUniqueID;
}
}
« no previous file with comments | « src/gpu/GrBitmapTextContext.h ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698