Clip FreeType glyph bitmap to mask.

Skia has for some time assumed that when using FT_Render_Glyph with one
of the LCD render modes that one extra pixel would be applied to each
side of the resulting bitmap. FreieType has changed to make this more
conservative when possible, so the pre-allocated SkMask and the generated
FT_Bitmap may no longer agree on the size and origin.

This change ensures the SkMask and FT_Bitmap are the same size and their
origins align. This is not an ideal long term fix, but is both simple and
localized for easy and quick back-porting, should that become necessary.

BUG=skia:6663

Original-Change-Id: I49ec8f45376be8d867e8aef54eab79537731c310
Reviewed-on: https://skia-review.googlesource.com/20327
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>

BUG=chromium:726631

Change-Id: I9740bc7df544b402720caaf97244ff1fb05f3b81
Cherry-Pick: 6cdb5f2ad7684302a8a66217462d2aef4c5f4632
Approval: https://crbug.com/726631#c69
Reviewed-on: https://skia-review.googlesource.com/28185
Reviewed-by: Ben Wagner <bungeman@google.com>
1 file changed