Skip to content

Commit

Permalink
Enable WebP (flutter#4359)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirh authored Nov 16, 2017
1 parent d917c35 commit 5afc1e2
Show file tree
Hide file tree
Showing 6 changed files with 926 additions and 11 deletions.
7 changes: 5 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
#
Expand Down Expand Up @@ -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',

Expand Down
3 changes: 3 additions & 0 deletions lib/ui/painting/codec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,21 @@ 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) {
return fxl::MakeRefCounted<MultiFrameCodec>(std::move(skCodec));
}
auto skImage = DecodeImage(buffer, trace_id);
if (!skImage) {
FXL_LOG(ERROR) << "DecodeImage failed";
return nullptr;
}
auto image = CanvasImage::Create();
Expand Down
Loading

0 comments on commit 5afc1e2

Please sign in to comment.