Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8870538f authored by Victoria Lease's avatar Victoria Lease
Browse files

make setHinting(HINTING_ON) kNormal_Hinting

Previously, the default hinting mode for a freshly-constructed Paint
object is equivalent to Skia's kNormal_Hinting mode, in which font
hints are respected if available. Calling
Paint.setHinting(HINTING_ON), however, is equivalent to setting
Skia's kSlight_Hinting mode, in which font hints are ignored in
favour of freetype-generated autohints.

This discrepancy is bad for a variety of reasons:
- Once Paint.setHinting() has been called, it is impossible to return
  to the default hinting level.
- Calling paint.setHinting(otherPaint.getHinting()) can result in
  paint having a different hinting level than otherPaint.
- Paint.setHinting(HINTING_ON) actually results in font hints being
  ignored, which is perhaps the opposite of the intended behaviour.

This commit resolves these discrepancies by making HINTING_ON
correspond to Skia's kNormal_Hinting setting.

Change-Id: Iefb8e051ef53bea783e6f3be37748985ec397bc5
Bug: 9466164
parent 636f119e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ public:
    static void setHinting(JNIEnv* env, jobject paint, jint mode) {
        NPE_CHECK_RETURN_VOID(env, paint);
        GraphicsJNI::getNativePaint(env, paint)->setHinting(
                mode == 0 ? SkPaint::kNo_Hinting : SkPaint::kSlight_Hinting);
                mode == 0 ? SkPaint::kNo_Hinting : SkPaint::kNormal_Hinting);
    }

    static void setAntiAlias(JNIEnv* env, jobject paint, jboolean aa) {