OSDN Git Service

Fix double bolding
authorSeigo Nonaka <nona@google.com>
Tue, 2 May 2017 05:17:36 +0000 (22:17 -0700)
committerSeigo Nonaka <nona@google.com>
Tue, 9 May 2017 03:58:29 +0000 (03:58 +0000)
commit264d3bef34c32dac82326d82c0e42136c5c82202
treec899b7ef7173fba1b75e51e996f7ded8bd5cb235
parentf14f5fa42f8ba6f9bd125896b30713820ef422c6
Fix double bolding

resolveStyle increases minikinStyle's weight value based on Skia's style
value. Since we compute Skia's style based on given weight value, we
should not add extra bold weight to minikinStyle.

This CL also fixes misunderstanding of base weight.
The base weight is only used for computing weight relative to the
weighted alias. Thus, base weight should not be updated except for
createWeightAlias method.

To be clear, this CL changes the function names but keeps the same
semantics as before.

Test: adb shell /data/nativetest/hwui_unit_tests/hwui_unit_tests
Test: am instrument -w -e class android.graphics.cts.TypefaceTest\
      android.graphics.cts/android.support.test.runner.AndroidJUnitRunner
Bug: 37880319

Change-Id: Ied73189b11792fb062da46f45afd2db664e6ecb4
(cherry picked from commit 1f9c461e6a9537f91a6509e73eeb04ee6d5706cf)
core/jni/android/graphics/FontFamily.cpp
core/jni/android/graphics/Typeface.cpp
graphics/java/android/graphics/Typeface.java
libs/hwui/Android.bp
libs/hwui/hwui/Typeface.cpp
libs/hwui/hwui/Typeface.h
libs/hwui/tests/unit/TypefaceTests.cpp [new file with mode: 0644]