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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 1010113004: Add GrRenderTarget parameter to GrTextContext::canDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 9 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/GrDistanceFieldTextContext.h ('k') | src/gpu/GrStencilAndCoverTextContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index 9ab228be8137dadcf897a2c047979f371e5fcc85..f0915a7555d52d307698e2bd7675723e9fce4c11 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -83,34 +83,38 @@ GrDistanceFieldTextContext::~GrDistanceFieldTextContext() {
SkSafeSetNull(fGammaTexture);
}
-bool GrDistanceFieldTextContext::canDraw(const SkPaint& paint, const SkMatrix& viewMatrix) {
+bool GrDistanceFieldTextContext::canDraw(const GrRenderTarget* rt,
+ const GrClip& clip,
+ const GrPaint& paint,
+ const SkPaint& skPaint,
+ const SkMatrix& viewMatrix) {
// TODO: support perspective (need getMaxScale replacement)
if (viewMatrix.hasPerspective()) {
return false;
}
SkScalar maxScale = viewMatrix.getMaxScale();
- SkScalar scaledTextSize = maxScale*paint.getTextSize();
+ SkScalar scaledTextSize = maxScale*skPaint.getTextSize();
// Hinted text looks far better at small resolutions
// Scaling up beyond 2x yields undesireable artifacts
if (scaledTextSize < kMinDFFontSize || scaledTextSize > 2*kLargeDFFontSize) {
return false;
}
- if (!fEnableDFRendering && !paint.isDistanceFieldTextTEMP() &&
+ if (!fEnableDFRendering && !skPaint.isDistanceFieldTextTEMP() &&
scaledTextSize < kLargeDFFontSize) {
return false;
}
// rasterizers and mask filters modify alpha, which doesn't
// translate well to distance
- if (paint.getRasterizer() || paint.getMaskFilter() ||
+ if (skPaint.getRasterizer() || skPaint.getMaskFilter() ||
!fContext->getTextTarget()->caps()->shaderDerivativeSupport()) {
return false;
}
// TODO: add some stroking support
- if (paint.getStyle() != SkPaint::kFill_Style) {
+ if (skPaint.getStyle() != SkPaint::kFill_Style) {
return false;
}
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.h ('k') | src/gpu/GrStencilAndCoverTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698