#joshualitt
texture_domain_effect
+
+#jvanverth https://codereview.chromium.org/703463002
+dftext
+nested_aa
+path-reverse
+pathfill
+polygons
+pathopsinverse
+rects
+
// mip levels
static const int kSmallMIP = 32;
-static const int kMediumMIP = 64;
-static const int kLargeMIP = 128;
+static const int kMediumMIP = 78;
+static const int kLargeMIP = 192;
////////////////////////////////////////////////////////////////////////////////
GrAADistanceFieldPathRenderer::GrAADistanceFieldPathRenderer(GrContext* context)
static const int kSmallDFFontSize = 32;
static const int kSmallDFFontLimit = 32;
-static const int kMediumDFFontSize = 64;
-static const int kMediumDFFontLimit = 64;
-static const int kLargeDFFontSize = 128;
+static const int kMediumDFFontSize = 78;
+static const int kMediumDFFontLimit = 78;
+static const int kLargeDFFontSize = 192;
namespace {
// position + texture coord
if (scaledTextSize <= kSmallDFFontLimit) {
fTextRatio = textSize / kSmallDFFontSize;
fSkPaint.setTextSize(SkIntToScalar(kSmallDFFontSize));
+#if DEBUG_TEXT_SIZE
+ fSkPaint.setColor(SkColorSetARGB(0xFF, 0x00, 0x00, 0xFF));
+ fPaint.setColor(GrColorPackRGBA(0x00, 0x00, 0xFF, 0xFF));
+#endif
} else if (scaledTextSize <= kMediumDFFontLimit) {
fTextRatio = textSize / kMediumDFFontSize;
fSkPaint.setTextSize(SkIntToScalar(kMediumDFFontSize));
+#if DEBUG_TEXT_SIZE
+ fSkPaint.setColor(SkColorSetARGB(0xFF, 0x00, 0xFF, 0x00));
+ fPaint.setColor(GrColorPackRGBA(0x00, 0xFF, 0x00, 0xFF));
+#endif
} else {
fTextRatio = textSize / kLargeDFFontSize;
fSkPaint.setTextSize(SkIntToScalar(kLargeDFFontSize));
+#if DEBUG_TEXT_SIZE
+ fSkPaint.setColor(SkColorSetARGB(0xFF, 0xFF, 0x00, 0x00));
+ fPaint.setColor(GrColorPackRGBA(0xFF, 0x00, 0x00, 0xFF));
+#endif
}
fUseLCDText = fSkPaint.isLCDRenderText();
#include "SkDistanceFieldGen.h"
-// To get optical sizes people don't complain about when we blit correctly,
-// we need to slightly bold each glyph. On the Mac, we need a larger bold value.
-#if defined(SK_BUILD_FOR_MAC)
-#define SK_DistanceFieldLCDFactor "0.33"
-#define SK_DistanceFieldNonLCDFactor "0.25"
-#else
-#define SK_DistanceFieldLCDFactor "0.05"
-#define SK_DistanceFieldNonLCDFactor "0.05"
-#endif
-
// Assuming a radius of the diagonal of the fragment, hence a factor of sqrt(2)/2
#define SK_DistanceFieldAAFactor "0.7071"
kVec2f_GrSLType);
fsBuilder->codeAppend(";\n");
fsBuilder->codeAppend("\tfloat distance = "
- SK_DistanceFieldMultiplier "*(texColor.r - " SK_DistanceFieldThreshold ")"
- "+ " SK_DistanceFieldNonLCDFactor ";\n");
+ SK_DistanceFieldMultiplier "*(texColor.r - " SK_DistanceFieldThreshold ");");
// we adjust for the effect of the transformation on the distance by using
// the length of the gradient of the texture coordinates. We use st coordinates
fsBuilder->codeAppend("\tdistance.z = texColor.r;\n");
fsBuilder->codeAppend("\tdistance = "
- "vec3(" SK_DistanceFieldMultiplier ")*(distance - vec3(" SK_DistanceFieldThreshold"))"
- "+ vec3(" SK_DistanceFieldLCDFactor ");\n");
+ "vec3(" SK_DistanceFieldMultiplier ")*(distance - vec3(" SK_DistanceFieldThreshold"));");
// we adjust for the effect of the transformation on the distance by using
// the length of the gradient of the texture coordinates. We use st coordinates