未验证 提交 5afc1e28 编写于 作者: A amirh 提交者: GitHub

Enable WebP (#4359)

上级 d917c35e
......@@ -21,8 +21,8 @@ vars = {
'chromium_git': 'https://chromium.googlesource.com',
'dart_git': 'https://dart.googlesource.com',
'fuchsia_git': 'https://fuchsia.googlesource.com',
'skia_git': 'https://skia.googlesource.com',
'github_git': 'https://github.com',
'skia_git': 'https://skia.googlesource.com',
'skia_revision': '09b8c91b696925c6c6a25c35173f2da27abf0fbe',
# When updating the Dart revision, ensure that all entries that are
......@@ -114,7 +114,7 @@ allowed_hosts = [
]
deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'd65893e469b3cdff75e0a157a5a219096ca6193a',
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'b70195e5d3c8d075a4ab939ba27d167bd241122f',
# Fuchsia compatibility
#
......@@ -355,6 +355,9 @@ deps = {
'src/third_party/libjpeg-turbo':
Var('skia_git') + '/third_party/libjpeg-turbo.git' + '@' + 'debddedc75850bcdeb8a57258572f48b802a4bb3',
'src/third_party/libwebp':
Var('chromium_git') + '/webm/libwebp.git' + '@' + '0.6.0',
'src/third_party/gyp':
Var('chromium_git') + '/external/gyp.git' + '@' + '4801a5331ae62da9769a327f11c4213d32fb0dad',
......
......@@ -69,11 +69,13 @@ fxl::RefPtr<Codec> InitCodec(sk_sp<SkData> buffer, size_t trace_id) {
TRACE_EVENT0("blink", "InitCodec");
if (buffer == nullptr || buffer->isEmpty()) {
FXL_LOG(ERROR) << "InitCodec failed - buffer was empty ";
return nullptr;
}
std::unique_ptr<SkCodec> skCodec = SkCodec::MakeFromData(buffer);
if (!skCodec) {
FXL_LOG(ERROR) << "SkCodec::MakeFromData failed";
return nullptr;
}
if (skCodec->getFrameCount() > 1) {
......@@ -81,6 +83,7 @@ fxl::RefPtr<Codec> InitCodec(sk_sp<SkData> buffer, size_t trace_id) {
}
auto skImage = DecodeImage(buffer, trace_id);
if (!skImage) {
FXL_LOG(ERROR) << "DecodeImage failed";
return nullptr;
}
auto image = CanvasImage::Create();
......
此差异已折叠。
......@@ -70,7 +70,6 @@ def to_gn_args(args):
gn_args['skia_enable_flutter_defines'] = True # Enable Flutter API guards in Skia.
gn_args['skia_use_dng_sdk'] = False # RAW image handling.
gn_args['skia_use_sfntly'] = False # PDF handling.
gn_args['skia_use_libwebp'] = False # Needs third_party/libwebp.
gn_args['skia_use_fontconfig'] = False # Use the custom font manager instead.
gn_args['is_official_build'] = True # Disable Skia test utilities.
......
......@@ -1740,6 +1740,18 @@ class RepositoryLibPngDirectory extends RepositoryDirectory {
}
}
class RepositoryLibWebpDirectory extends RepositoryDirectory {
RepositoryLibWebpDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io);
@override
bool shouldRecurse(fs.IoNode entry) {
return entry.name != 'examples' // contains nothing that ends up in the binary executable
&& entry.name != 'swig' // not included in our build
&& entry.name != 'gradle' // not included in our build
&& super.shouldRecurse(entry);
}
}
class RepositoryPkgDirectory extends RepositoryDirectory {
RepositoryPkgDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io);
......@@ -1903,6 +1915,8 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec
return new RepositoryLibJpegTurboDirectory(this, entry);
if (entry.name == 'libpng')
return new RepositoryLibPngDirectory(this, entry);
if (entry.name == 'libwebp')
return new RepositoryLibWebpDirectory(this, entry);
if (entry.name == 'okhttp')
return new RepositoryOkHttpDirectory(this, entry);
if (entry.name == 'pkg')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册