mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
extra/chromium to 59.0.3071.115-1
This commit is contained in:
parent
60a688451d
commit
03368f37a6
2 changed files with 183 additions and 2 deletions
170
extra/chromium/0001-Clip-FreeType-glyph-bitmap-to-mask.patch
Normal file
170
extra/chromium/0001-Clip-FreeType-glyph-bitmap-to-mask.patch
Normal file
|
@ -0,0 +1,170 @@
|
|||
From 6cdb5f2ad7684302a8a66217462d2aef4c5f4632 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Wagner <bungeman@behemoth.cnc.corp.google.com>
|
||||
Date: Thu, 15 Jun 2017 10:43:17 -0400
|
||||
Subject: [PATCH] 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
|
||||
|
||||
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>
|
||||
---
|
||||
src/ports/SkFontHost_FreeType_common.cpp | 100 +++++++++++++++++++++++++------
|
||||
1 file changed, 83 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp
|
||||
index 9df7268bb4..a216fdb29c 100644
|
||||
--- a/src/ports/SkFontHost_FreeType_common.cpp
|
||||
+++ b/src/ports/SkFontHost_FreeType_common.cpp
|
||||
@@ -395,8 +395,6 @@ void SkScalerContext_FreeType_Base::generateGlyphImage(
|
||||
switch ( face->glyph->format ) {
|
||||
case FT_GLYPH_FORMAT_OUTLINE: {
|
||||
FT_Outline* outline = &face->glyph->outline;
|
||||
- FT_BBox bbox;
|
||||
- FT_Bitmap target;
|
||||
|
||||
int dx = 0, dy = 0;
|
||||
if (fRec.fFlags & SkScalerContext::kSubpixelPositioning_Flag) {
|
||||
@@ -405,36 +403,97 @@ void SkScalerContext_FreeType_Base::generateGlyphImage(
|
||||
// negate dy since freetype-y-goes-up and skia-y-goes-down
|
||||
dy = -dy;
|
||||
}
|
||||
- FT_Outline_Get_CBox(outline, &bbox);
|
||||
- /*
|
||||
- what we really want to do for subpixel is
|
||||
- offset(dx, dy)
|
||||
- compute_bounds
|
||||
- offset(bbox & !63)
|
||||
- but that is two calls to offset, so we do the following, which
|
||||
- achieves the same thing with only one offset call.
|
||||
- */
|
||||
- FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63),
|
||||
- dy - ((bbox.yMin + dy) & ~63));
|
||||
+
|
||||
+ memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);
|
||||
|
||||
if (SkMask::kLCD16_Format == glyph.fMaskFormat) {
|
||||
+ FT_Outline_Translate(outline, dx, dy);
|
||||
FT_Error err = FT_Render_Glyph(face->glyph, doVert ? FT_RENDER_MODE_LCD_V :
|
||||
FT_RENDER_MODE_LCD);
|
||||
if (err) {
|
||||
SK_TRACEFTR(err, "Could not render glyph.");
|
||||
- sk_bzero(glyph.fImage, glyph.computeImageSize());
|
||||
return;
|
||||
}
|
||||
+
|
||||
SkMask mask;
|
||||
glyph.toMask(&mask);
|
||||
+#ifdef SK_SHOW_TEXT_BLIT_COVERAGE
|
||||
+ memset(mask.fImage, 0x80, mask.fBounds.height() * mask.fRowBytes);
|
||||
+#endif
|
||||
+ FT_GlyphSlotRec& ftGlyph = *face->glyph;
|
||||
+
|
||||
+ if (!SkIRect::Intersects(mask.fBounds,
|
||||
+ SkIRect::MakeXYWH( ftGlyph.bitmap_left,
|
||||
+ -ftGlyph.bitmap_top,
|
||||
+ ftGlyph.bitmap.width,
|
||||
+ ftGlyph.bitmap.rows)))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // If the FT_Bitmap extent is larger, discard bits of the bitmap outside the mask.
|
||||
+ // If the SkMask extent is larger, shrink mask to fit bitmap (clearing discarded).
|
||||
+ unsigned char* origBuffer = ftGlyph.bitmap.buffer;
|
||||
+ // First align the top left (origin).
|
||||
+ if (-ftGlyph.bitmap_top < mask.fBounds.fTop) {
|
||||
+ int32_t topDiff = mask.fBounds.fTop - (-ftGlyph.bitmap_top);
|
||||
+ ftGlyph.bitmap.buffer += ftGlyph.bitmap.pitch * topDiff;
|
||||
+ ftGlyph.bitmap.rows -= topDiff;
|
||||
+ ftGlyph.bitmap_top = -mask.fBounds.fTop;
|
||||
+ }
|
||||
+ if (ftGlyph.bitmap_left < mask.fBounds.fLeft) {
|
||||
+ int32_t leftDiff = mask.fBounds.fLeft - ftGlyph.bitmap_left;
|
||||
+ ftGlyph.bitmap.buffer += leftDiff;
|
||||
+ ftGlyph.bitmap.width -= leftDiff;
|
||||
+ ftGlyph.bitmap_left = mask.fBounds.fLeft;
|
||||
+ }
|
||||
+ if (mask.fBounds.fTop < -ftGlyph.bitmap_top) {
|
||||
+ mask.fImage += mask.fRowBytes * (-ftGlyph.bitmap_top - mask.fBounds.fTop);
|
||||
+ mask.fBounds.fTop = -ftGlyph.bitmap_top;
|
||||
+ }
|
||||
+ if (mask.fBounds.fLeft < ftGlyph.bitmap_left) {
|
||||
+ mask.fImage += sizeof(uint16_t) * (ftGlyph.bitmap_left - mask.fBounds.fLeft);
|
||||
+ mask.fBounds.fLeft = ftGlyph.bitmap_left;
|
||||
+ }
|
||||
+ // Origins aligned, clean up the width and height.
|
||||
+ int ftVertScale = (doVert ? 3 : 1);
|
||||
+ int ftHoriScale = (doVert ? 1 : 3);
|
||||
+ if (mask.fBounds.height() * ftVertScale < SkToInt(ftGlyph.bitmap.rows)) {
|
||||
+ ftGlyph.bitmap.rows = mask.fBounds.height() * ftVertScale;
|
||||
+ }
|
||||
+ if (mask.fBounds.width() * ftHoriScale < SkToInt(ftGlyph.bitmap.width)) {
|
||||
+ ftGlyph.bitmap.width = mask.fBounds.width() * ftHoriScale;
|
||||
+ }
|
||||
+ if (SkToInt(ftGlyph.bitmap.rows) < mask.fBounds.height() * ftVertScale) {
|
||||
+ mask.fBounds.fBottom = mask.fBounds.fTop + ftGlyph.bitmap.rows / ftVertScale;
|
||||
+ }
|
||||
+ if (SkToInt(ftGlyph.bitmap.width) < mask.fBounds.width() * ftHoriScale) {
|
||||
+ mask.fBounds.fRight = mask.fBounds.fLeft + ftGlyph.bitmap.width / ftHoriScale;
|
||||
+ }
|
||||
if (fPreBlend.isApplicable()) {
|
||||
- copyFT2LCD16<true>(face->glyph->bitmap, mask, doBGR,
|
||||
+ copyFT2LCD16<true>(ftGlyph.bitmap, mask, doBGR,
|
||||
fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
|
||||
} else {
|
||||
- copyFT2LCD16<false>(face->glyph->bitmap, mask, doBGR,
|
||||
+ copyFT2LCD16<false>(ftGlyph.bitmap, mask, doBGR,
|
||||
fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);
|
||||
}
|
||||
+ // Restore the buffer pointer so FreeType can properly free it.
|
||||
+ ftGlyph.bitmap.buffer = origBuffer;
|
||||
} else {
|
||||
+ FT_BBox bbox;
|
||||
+ FT_Bitmap target;
|
||||
+ FT_Outline_Get_CBox(outline, &bbox);
|
||||
+ /*
|
||||
+ what we really want to do for subpixel is
|
||||
+ offset(dx, dy)
|
||||
+ compute_bounds
|
||||
+ offset(bbox & !63)
|
||||
+ but that is two calls to offset, so we do the following, which
|
||||
+ achieves the same thing with only one offset call.
|
||||
+ */
|
||||
+ FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63),
|
||||
+ dy - ((bbox.yMin + dy) & ~63));
|
||||
+
|
||||
target.width = glyph.fWidth;
|
||||
target.rows = glyph.fHeight;
|
||||
target.pitch = glyph.rowBytes();
|
||||
@@ -442,8 +501,15 @@ void SkScalerContext_FreeType_Base::generateGlyphImage(
|
||||
target.pixel_mode = compute_pixel_mode( (SkMask::Format)fRec.fMaskFormat);
|
||||
target.num_grays = 256;
|
||||
|
||||
- memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);
|
||||
FT_Outline_Get_Bitmap(face->glyph->library, outline, &target);
|
||||
+#ifdef SK_SHOW_TEXT_BLIT_COVERAGE
|
||||
+ for (int y = 0; y < glyph.fHeight; ++y) {
|
||||
+ for (int x = 0; x < glyph.fWidth; ++x) {
|
||||
+ uint8_t& a = ((uint8_t*)glyph.fImage)[(glyph.rowBytes() * y) + x];
|
||||
+ a = SkTMax<uint8_t>(a, 0x20);
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
}
|
||||
} break;
|
||||
|
||||
--
|
||||
2.13.2
|
||||
|
|
@ -33,9 +33,10 @@ declare -rgA _system_libs=(
|
|||
)
|
||||
|
||||
pkgname=chromium
|
||||
pkgver=59.0.3071.109
|
||||
pkgver=59.0.3071.115
|
||||
pkgrel=1
|
||||
_launcher_ver=5
|
||||
_freetype_rev=5a3490e054bda8a318ebde482
|
||||
pkgdesc="A web browser built for speed, simplicity, and security"
|
||||
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
|
||||
url="https://www.chromium.org/Home"
|
||||
|
@ -51,20 +52,24 @@ optdepends=('kdialog: needed for file dialogs in KDE'
|
|||
install=chromium.install
|
||||
source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
|
||||
chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
|
||||
chromium-freetype2::git+https://chromium.googlesource.com/chromium/src/third_party/freetype2#commit=$_freetype_rev
|
||||
chromium.desktop
|
||||
chromium-system-ffmpeg-r6.patch
|
||||
0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
|
||||
0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch
|
||||
0001-Clip-FreeType-glyph-bitmap-to-mask.patch
|
||||
chromium-blink-gcc7.patch
|
||||
chromium-v8-gcc7.patch
|
||||
chromium-widevine.patch
|
||||
0001-ARM-toolchain-fixes.patch)
|
||||
sha256sums=('83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9'
|
||||
sha256sums=('37cbc9955ae3b25cd4e9851a82ea97a0035021cc90658902938ad1c20f263170'
|
||||
'4dc3428f2c927955d9ae117f2fb24d098cc6dd67adb760ac9c82b522ec8b0587'
|
||||
'SKIP'
|
||||
'028a748a5c275de9b8f776f97909f999a8583a4b77fd1cd600b4fc5c0c3e91e9'
|
||||
'2fc21f48b95f9f2c2bd8576742fcf8028a8877c6b6e96c04d88184915982234e'
|
||||
'9c081c84a4f85dbef82a9edf34cf0b1e8377c563874fd9c1b4efddf1476748f9'
|
||||
'42eb6ada30d5d507f2bda2d2caece37e397e7086bc0d430db776fad143562fb6'
|
||||
'e60aa0ff01f8bee67e45fde7bbe932901194984673ec4b10ea82bba1bace0cd7'
|
||||
'f94310a7ba9b8b777adfb4442bcc0a8f0a3d549b2cf4a156066f8e2e28e2f323'
|
||||
'46dacc4fa52652b7d99b8996d6a97e5e3bac586f879aefb9fb95020d2c4e5aec'
|
||||
'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808'
|
||||
|
@ -82,6 +87,9 @@ _google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4
|
|||
prepare() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
|
||||
# https://groups.google.com/a/chromium.org/d/msg/chromium-packagers/wuInaKJkosg/kMfIV_7wDgAJ
|
||||
mv "$srcdir/chromium-freetype2" third_party/freetype/src
|
||||
|
||||
# Arch Linux ARM fixes
|
||||
patch -Np1 -i ../0001-ARM-toolchain-fixes.patch
|
||||
|
||||
|
@ -97,6 +105,9 @@ prepare() {
|
|||
patch -Np1 -i ../0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
|
||||
patch -Np1 -i ../0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch
|
||||
|
||||
# https://bugs.chromium.org/p/skia/issues/detail?id=6663
|
||||
patch -Np1 -d third_party/skia <../0001-Clip-FreeType-glyph-bitmap-to-mask.patch
|
||||
|
||||
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347
|
||||
patch -Np1 -i ../chromium-blink-gcc7.patch
|
||||
|
||||
|
|
Loading…
Reference in a new issue