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

Unified Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 820523002: initial changes to add local matrix to primitive processor (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup-ccm-above-context
Patch Set: cleanup 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/GrStencilAndCoverTextContext.h ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilAndCoverTextContext.cpp
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index 7cda4f9f4374043f2fd9ca317ef14ba61b989c41..b5ab52319c953bdbbb6796804af5ce51c1f4b9d9 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -234,6 +234,7 @@ void GrStencilAndCoverTextContext::init(const GrPaint& paint,
fContextInitialMatrix = viewMatrix;
fViewMatrix = viewMatrix;
+ fLocalMatrix = SkMatrix::I();
const bool otherBackendsWillDrawAsPaths =
SkDraw::ShouldDrawTextAsPaths(skPaint, fContextInitialMatrix);
@@ -262,7 +263,10 @@ void GrStencilAndCoverTextContext::init(const GrPaint& paint,
// the paint preConcats the inverse.
m = fContextInitialMatrix;
m.postScale(1, -1);
- fPaint.localCoordChangeInverse(m);
+ if (!m.invert(&fLocalMatrix)) {
+ SkDebugf("Not invertible!\n");
+ return;
+ }
fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, &fContextInitialMatrix,
true /*ignoreGamma*/);
@@ -331,8 +335,8 @@ void GrStencilAndCoverTextContext::init(const GrPaint& paint,
SkMatrix textMatrix;
// Glyphs loaded by GPU path rendering have an inverted y-direction.
textMatrix.setScale(fTextRatio, -fTextRatio);
- fPaint.localCoordChange(textMatrix);
fViewMatrix.preConcat(textMatrix);
+ fLocalMatrix = textMatrix;
fGlyphCache = fSkPaint.detachCache(&fDeviceProperties, NULL, true /*ignoreGamma*/);
fGlyphs = canUseRawPaths ?
@@ -402,7 +406,7 @@ static const SkScalar* get_xy_scalar_array(const SkPoint* pointArray) {
void GrStencilAndCoverTextContext::flush() {
if (fQueuedGlyphCount > 0) {
- SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(fPaint.getColor()));
+ SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(fPaint.getColor(), fLocalMatrix));
fDrawTarget->drawPaths(&fDrawState, pp, fGlyphs,
fGlyphIndices, GrPathRange::kU16_PathIndexType,
get_xy_scalar_array(fGlyphPositions),
@@ -426,7 +430,6 @@ void GrStencilAndCoverTextContext::flush() {
SkMatrix inverse;
if (this->mapToFallbackContext(&inverse)) {
- paintFallback.localCoordChangeInverse(inverse);
inverse.mapPoints(&fGlyphPositions[fFallbackGlyphsIdx], fallbackGlyphCount);
}
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.h ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698