commit e673b47df014849b69f2e58f22664982749a888f
Author: Akarshan Biswas <akarshan.biswas(a)gmail.com>
Date: Wed Nov 7 16:35:02 2018 +0530
Re brand chromium-vaapi and update vaapi patch
Signed-off-by: Akarshan Biswas <akarshan.biswas(a)gmail.com>
brand.patch | 25 +++++++++
chromium-harfbuzz2.patch | 80 +++++++++++++++++++++++++++
chromium-vaapi.spec | 14 ++++-
enable-vaapi.patch | 139 +++++++++++++++++++++++++++++------------------
4 files changed, 204 insertions(+), 54 deletions(-)
---
diff --git a/brand.patch b/brand.patch
new file mode 100644
index 0000000..002c423
--- /dev/null
+++ b/brand.patch
@@ -0,0 +1,25 @@
+From bfff7b95bb4d9ff20a3a67191dfffe25334f9dca Mon Sep 17 00:00:00 2001
+From: Akarshan Biswas <akarshan.biswas(a)gmail.com>
+Date: Wed, 7 Nov 2018 16:29:01 +0530
+Subject: [PATCH] Let's brand chromium-vaapi
+
+---
+ components/version_ui_strings.grdp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/components/version_ui_strings.grdp b/components/version_ui_strings.grdp
+index 6278a8a38..1611b4c80 100644
+--- a/components/version_ui_strings.grdp
++++ b/components/version_ui_strings.grdp
+@@ -7,7 +7,7 @@
+ Official Build
+ </message>
+ <message name="IDS_VERSION_UI_UNOFFICIAL" desc="unofficial build on
the about:version page">
+- Developer Build
++ RPMFusion Build
+ </message>
+ <message name="IDS_VERSION_UI_32BIT" desc="32-bit on the
chrome://version page">
+ (32-bit)
+--
+2.19.1
+
diff --git a/chromium-harfbuzz2.patch b/chromium-harfbuzz2.patch
new file mode 100644
index 0000000..2d5602d
--- /dev/null
+++ b/chromium-harfbuzz2.patch
@@ -0,0 +1,80 @@
+From 7ae38170a117e909bb28e1470842b68de3501197 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppymaster(a)gmail.com>
+Date: Sun, 21 Oct 2018 10:06:53 -0400
+Subject: [PATCH] blink: add 'const' modifier for harfbuzz hb_codepoint_t
+ pointers
+
+This resolves a build failure against harfbuzz 2.0.
+
+Based on a patch by Alexandre Fierreira.
+
+Bug:
https://bugs.gentoo.org/669034
+---
+ .../renderer/platform/fonts/shaping/harfbuzz_face.cc | 2 +-
+ .../renderer/platform/fonts/skia/skia_text_metrics.cc | 9 +++++++--
+ .../renderer/platform/fonts/skia/skia_text_metrics.h | 2 +-
+ 3 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
+index 8e7d91ca371f..e279a5876cb3 100644
+--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc
+@@ -139,7 +139,7 @@ static hb_position_t HarfBuzzGetGlyphHorizontalAdvance(hb_font_t*
hb_font,
+ static void HarfBuzzGetGlyphHorizontalAdvances(hb_font_t* font,
+ void* font_data,
+ unsigned count,
+- hb_codepoint_t* first_glyph,
++ const hb_codepoint_t* first_glyph,
+ unsigned int glyph_stride,
+ hb_position_t* first_advance,
+ unsigned int advance_stride,
+diff --git a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
+index 77ec6209fab9..9f9070921448 100644
+--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
++++ b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.cc
+@@ -18,6 +18,11 @@ T* advance_by_byte_size(T* p, unsigned byte_size) {
+ return reinterpret_cast<T*>(reinterpret_cast<uint8_t*>(p) + byte_size);
+ }
+
++template <class T>
++T* advance_by_byte_size_const(T* p, unsigned byte_size) {
++ return reinterpret_cast<T*>(reinterpret_cast<const uint8_t*>(p) +
byte_size);
++}
++
+ } // namespace
+
+ SkiaTextMetrics::SkiaTextMetrics(const SkPaint* paint) : paint_(paint) {
+@@ -39,7 +44,7 @@ void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(hb_codepoint_t
codepoint,
+ }
+
+ void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(unsigned count,
+- hb_codepoint_t* glyphs,
++ const hb_codepoint_t* glyphs,
+ unsigned glyph_stride,
+ hb_position_t* advances,
+ unsigned advance_stride) {
+@@ -48,7 +53,7 @@ void SkiaTextMetrics::GetGlyphWidthForHarfBuzz(unsigned count,
+ // array that copy them to a regular array.
+ Vector<Glyph, 256> glyph_array(count);
+ for (unsigned i = 0; i < count;
+- i++, glyphs = advance_by_byte_size(glyphs, glyph_stride)) {
++ i++, glyphs = advance_by_byte_size_const(glyphs, glyph_stride)) {
+ glyph_array[i] = *glyphs;
+ }
+ Vector<SkScalar, 256> sk_width_array(count);
+diff --git a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
+index 787d8af0375a..3bc4407c641b 100644
+--- a/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
++++ b/third_party/blink/renderer/platform/fonts/skia/skia_text_metrics.h
+@@ -19,7 +19,7 @@ class SkiaTextMetrics final {
+
+ void GetGlyphWidthForHarfBuzz(hb_codepoint_t, hb_position_t* width);
+ void GetGlyphWidthForHarfBuzz(unsigned count,
+- hb_codepoint_t* first_glyph,
++ const hb_codepoint_t* first_glyph,
+ unsigned glyph_stride,
+ hb_position_t* first_advance,
+ unsigned advance_stride);
+--
+2.19.1
+
diff --git a/chromium-vaapi.spec b/chromium-vaapi.spec
index 95aff15..53162ca 100644
--- a/chromium-vaapi.spec
+++ b/chromium-vaapi.spec
@@ -70,7 +70,7 @@
##############################Package Definitions######################################
Name: chromium-vaapi
Version: 70.0.3538.77
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A Chromium web browser with video decoding acceleration
License: BSD and LGPLv2+ and ASL 2.0 and IJG and MIT and GPLv2+ and ISC and OpenSSL
and (MPLv1.1 or GPLv2 or LGPLv2)
URL:
https://www.chromium.org/Home
@@ -123,6 +123,12 @@ Patch50: unrar.patch
Patch51: py2-bootstrap.patch
# Fix building with system icu
Patch52: chromium-system-icu.patch
+%if 0%{?fedora} >= 30
+# Fix chromium build with harfbuzz 2 in rawhide
+Patch53: chromium-harfbuzz2.patch
+%endif
+# Let's brand chromium!
+Patch54: brand.patch
# This build should be only available to amd64
ExclusiveArch: x86_64
########################################################################################
@@ -437,7 +443,7 @@ mkdir -p third_party/node/linux/node-linux-x64/bin
ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
# Hard code extra version
FILE=chrome/common/channel_info_posix.cc
-sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"chromium-vaapi
Fedora Project"/' $FILE
+sed -i.orig -e
's/getenv("CHROME_VERSION_EXTRA")/"chromium-vaapi"/' $FILE
#####################################BUILD#############################################
%build
#export compilar variables
@@ -625,6 +631,10 @@ appstream-util validate-relax --nonet
"%{buildroot}%{_metainfodir}/%{name}.appda
%{chromiumdir}/locales/*.pak
#########################################changelogs#################################################
%changelog
+* Wed Nov 07 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 70.0.3538.77-2
+- Use correct branding in chromium
+- update vaapi patch
+
* Fri Oct 26 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 70.0.3538.77-1
- Update to 70.0.3538.77
- Add a patch to fix building with system libicu
diff --git a/enable-vaapi.patch b/enable-vaapi.patch
index 2cb451e..6211000 100644
--- a/enable-vaapi.patch
+++ b/enable-vaapi.patch
@@ -1,46 +1,25 @@
-From a4d39ad4677cbc83c5e32a205d25c27beb84e13c Mon Sep 17 00:00:00 2001
-From: Akarshan Biswas <hellbanger(a)ga-lmt-s2.biswasab.org>
-Date: Fri, 19 Oct 2018 19:19:44 +0530
-Subject: [PATCH] Enable hardware video decoding and encoding using libva vaapi
+From 9eef10b939b9eee6e7bb58c4ca3a8e119df518c1 Mon Sep 17 00:00:00 2001
+From: Akarshan Biswas <akarshan.biswas(a)gmail.com>
+Date: Sun, 4 Nov 2018 20:26:54 +0530
+Subject: [PATCH] Enable vaapi on Linux
+
---
- chrome/browser/about_flags.cc | 14 +++++++-------
- chrome/browser/flag_descriptions.cc | 6 +++---
- chrome/browser/flag_descriptions.h | 8 ++++++--
+ chrome/browser/about_flags.cc | 14 +++++++------
+ chrome/browser/flag_descriptions.cc | 22 +++++++++++++-------
+ chrome/browser/flag_descriptions.h | 16 +++++++++-----
components/viz/service/main/viz_main_impl.cc | 2 +-
- content/gpu/BUILD.gn | 5 +++++
+ content/gpu/BUILD.gn | 6 ++++++
content/gpu/gpu_main.cc | 4 ++--
- gpu/config/software_rendering_list.json | 11 -----------
+ gpu/config/software_rendering_list.json | 11 ----------
media/base/media_switches.cc | 2 +-
media/filters/BUILD.gn | 3 ++-
media/gpu/BUILD.gn | 7 +++++++
- 10 files changed, 34 insertions(+), 28 deletions(-)
+ 10 files changed, 52 insertions(+), 35 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
-index d029d0648..942f3627b 100644
+index d029d0648..39df8d6cf 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
-@@ -1386,18 +1386,18 @@ const FeatureEntry kFeatureEntries[] = {
- flag_descriptions::kUiPartialSwapDescription, kOsAll,
- SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
- {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
-- flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
-+ flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS | kOsLinux,
- SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
- {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
- flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
- SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
- {"enable-webrtc-hw-h264-encoding",
- flag_descriptions::kWebrtcHwH264EncodingName,
-- flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
-+ flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS |
kOsLinux,
- FEATURE_VALUE_TYPE(features::kWebRtcHWH264Encoding)},
- {"enable-webrtc-hw-vp8-encoding",
- flag_descriptions::kWebrtcHwVP8EncodingName,
-- flag_descriptions::kWebrtcHwVP8EncodingDescription, kOsAndroid | kOsCrOS,
-+ flag_descriptions::kWebrtcHwVP8EncodingDescription, kOsAndroid | kOsCrOS |
kOsLinux,
- FEATURE_VALUE_TYPE(features::kWebRtcHWVP8Encoding)},
- #if !defined(OS_ANDROID)
- {"enable-webrtc-remote-event-log",
@@ -1775,7 +1775,7 @@ const FeatureEntry kFeatureEntries[] = {
"disable-accelerated-video-decode",
flag_descriptions::kAcceleratedVideoDecodeName,
@@ -66,8 +45,25 @@ index d029d0648..942f3627b 100644
{"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
flag_descriptions::kV8CacheOptionsDescription, kOsAll,
MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
+@@ -4444,12 +4444,14 @@ const FeatureEntry kFeatureEntries[] = {
+ "AutofillDropdownLayout")},
+ #endif // OS_ANDROID
+
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || defined(OS_LINUX)
+ {"enable-vaapi-jpeg-image-decode-acceleration",
+ flag_descriptions::kVaapiJpegImageDecodeAccelerationName,
+- flag_descriptions::kVaapiJpegImageDecodeAccelerationDescription, kOsCrOS,
++ flag_descriptions::kVaapiJpegImageDecodeAccelerationDescription, kOsCrOS |
kOsLinux,
+ FEATURE_VALUE_TYPE(features::kVaapiJpegImageDecodeAcceleration)},
++#endif
+
++#if defined(OS_CHROMEOS)
+ {"enable-home-launcher-gestures",
+ flag_descriptions::kEnableHomeLauncherGesturesName,
+ flag_descriptions::kEnableHomeLauncherGesturesDescription, kOsCrOS,
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
-index 0cb812619..b53567008 100644
+index 0cb812619..df8ecb24e 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -3053,9 +3053,9 @@ const char kTextSuggestionsTouchBarDescription[] =
@@ -75,46 +71,84 @@ index 0cb812619..b53567008 100644
#endif
-// Chrome OS -------------------------------------------------------------------
-+// Chrome OS and
Linux-------------------------------------------------------------------
++// Chrome OS and Linux
-------------------------------------------------------------------
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
const char kAcceleratedMjpegDecodeName[] =
"Hardware-accelerated mjpeg decode for captured frame";
-@@ -3595,7 +3595,7 @@ const char kZipArchiverUnpackerName[] = "ZIP archiver -
Unpacker";
- const char kZipArchiverUnpackerDescription[] =
- "Enable or disable the ability to unpack archives in incognito mode";
-
--#endif // defined(OS_CHROMEOS)
-+#endif // defined(OS_CHROMEOS) defined(OS_LINUX)
+@@ -3063,6 +3063,18 @@ const char kAcceleratedMjpegDecodeDescription[] =
+ "Enable hardware-accelerated mjpeg decode for captured frame where "
+ "available.";
- // Random platform combinations -----------------------------------------------
++const char kVaapiJpegImageDecodeAccelerationName[] =
++ "VA-API JPEG decode acceleration for images";
++const char kVaapiJpegImageDecodeAccelerationDescription[] =
++ "Enable or disable decode acceleration of JPEG images (as opposed to
camera"
++ " captures) using the VA-API.";
++
++#endif // defined(OS_CHROMEOS) defined(OS_LINUX) and !defined(OS_ANDROID)
++
++// Only Chrome OS ------------------------------------------------------
++
++#if defined(OS_CHROMEOS)
++
+ const char kAllowTouchpadThreeFingerClickName[] = "Touchpad
three-finger-click";
+ const char kAllowTouchpadThreeFingerClickDescription[] =
+ "Enables touchpad three-finger-click as middle button.";
+@@ -3564,12 +3576,6 @@ const char kUseMonitorColorSpaceDescription[] =
+ "Enables Chrome to use the color space information provided by the
monitor"
+ " instead of the default sRGB color space.";
+-const char kVaapiJpegImageDecodeAccelerationName[] =
+- "VA-API JPEG decode acceleration for images";
+-const char kVaapiJpegImageDecodeAccelerationDescription[] =
+- "Enable or disable decode acceleration of JPEG images (as opposed to
camera"
+- " captures) using the VA-API.";
+-
+ const char kVideoPlayerChromecastSupportName[] =
+ "Experimental Chromecast support for Video Player";
+ const char kVideoPlayerChromecastSupportDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
-index b3c5e5691..3306c5a27 100644
+index b3c5e5691..14d7e33e9 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
-@@ -1846,13 +1846,17 @@ extern const char
kPermissionPromptPersistenceToggleDescription[];
+@@ -1846,13 +1846,22 @@ extern const char
kPermissionPromptPersistenceToggleDescription[];
#endif // defined(OS_MACOSX)
-// Chrome OS ------------------------------------------------------------------
++// Chrome OS and Linux
------------------------------------------------------------------
-#if defined(OS_CHROMEOS)
-+
-+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
extern const char kAcceleratedMjpegDecodeName[];
extern const char kAcceleratedMjpegDecodeDescription[];
++extern const char kVaapiJpegImageDecodeAccelerationName[];
++extern const char kVaapiJpegImageDecodeAccelerationDescription[];
++
+#endif
-+// Only Chrome OS ------------------------------------------------------------------
++
++// Chrome OS ----------------------------------------------------------------------
++
+#if defined(OS_CHROMEOS)
+
extern const char kAllowTouchpadThreeFingerClickName[];
extern const char kAllowTouchpadThreeFingerClickDescription[];
+@@ -2158,9 +2167,6 @@ extern const char kUseMashDescription[];
+ extern const char kUseMonitorColorSpaceName[];
+ extern const char kUseMonitorColorSpaceDescription[];
+
+-extern const char kVaapiJpegImageDecodeAccelerationName[];
+-extern const char kVaapiJpegImageDecodeAccelerationDescription[];
+-
+ extern const char kVideoPlayerChromecastSupportName[];
+ extern const char kVideoPlayerChromecastSupportDescription[];
+
diff --git a/components/viz/service/main/viz_main_impl.cc
b/components/viz/service/main/viz_main_impl.cc
index 2196abef4..b4e0a1ae1 100644
--- a/components/viz/service/main/viz_main_impl.cc
@@ -129,7 +163,7 @@ index 2196abef4..b4e0a1ae1 100644
// type of process.
thread_options.priority = base::ThreadPriority::DISPLAY;
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
-index 8974e441d..24b7acd3d 100644
+index 8974e441d..d7eba85a9 100644
--- a/content/gpu/BUILD.gn
+++ b/content/gpu/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/jumbo.gni")
@@ -140,13 +174,14 @@ index 8974e441d..24b7acd3d 100644
import("//ui/ozone/ozone.gni")
# See //content/BUILD.gn for how this works.
-@@ -134,4 +135,8 @@ target(link_target_type, "gpu_sources") {
+@@ -134,4 +135,9 @@ target(link_target_type, "gpu_sources") {
(!is_chromecast || is_cast_desktop_build)) {
configs += [ "//build/config/linux/dri" ]
}
-+ # Use vaapi on desktop Linux builds when use_vaapi is set
++
++ # Use vaapi on desktop Linux builds when use_vaapi is set
+ if (is_desktop_linux && use_vaapi) {
-+ public_configs = [ "//media/gpu:libva_config" ]
++ public_configs = [ "//media/gpu:libva_config" ]
+ }
}
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
@@ -253,5 +288,5 @@ index 9ef4730a4..0c3a06c24 100644
}
--
-2.17.2
+2.19.1