Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: dm/DM.cpp

Issue 2045293002: Add support for multiple frames in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: If BUILD needs SkGifCodec, it needs GIFImageReader Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« BUILD.gn ('K') | « BUILD.gn ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 0ce3738e327aab5c8346b7f629ae8955d48d3ff5..e06f409ccc152dcda7346d1b5f5b5bbf4e0d571a 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -36,6 +36,8 @@
#include "sk_tool_utils.h"
#include "SkScan.h"
+#include <vector>
+
#ifdef SK_PDF_IMAGE_STATS
extern void SkPDFImageDumpStats();
#endif
@@ -357,10 +359,11 @@ static void push_src(const char* tag, ImplicitString options, Src* s) {
static void push_codec_src(Path path, CodecSrc::Mode mode, CodecSrc::DstColorType dstColorType,
SkAlphaType dstAlphaType, float scale) {
if (FLAGS_simpleCodec) {
- if (mode != CodecSrc::kCodec_Mode || dstColorType != CodecSrc::kGetFromCanvas_DstColorType
- || scale != 1.0f)
+ const bool simple = CodecSrc::kCodec_Mode == mode || CodecSrc::kAnimated_Mode == mode;
+ if (!simple || dstColorType != CodecSrc::kGetFromCanvas_DstColorType || scale != 1.0f) {
// Only decode in the simple case.
return;
+ }
}
SkString folder;
switch (mode) {
@@ -382,6 +385,9 @@ static void push_codec_src(Path path, CodecSrc::Mode mode, CodecSrc::DstColorTyp
case CodecSrc::kSubset_Mode:
folder.append("codec_subset");
break;
+ case CodecSrc::kAnimated_Mode:
+ folder.append("codec_animated");
+ break;
}
switch (dstColorType) {
@@ -574,6 +580,15 @@ static void push_codec_srcs(Path path) {
}
}
+ {
+ std::vector<SkCodec::FrameInfo> frameInfos = codec->getFrameInfo();
+ if (frameInfos.size() > 1) {
+ push_codec_src(path, CodecSrc::kAnimated_Mode, CodecSrc::kGetFromCanvas_DstColorType,
+ kPremul_SkAlphaType, 1.0f);
+ }
+
+ }
+
if (FLAGS_simpleCodec) {
return;
}
« BUILD.gn ('K') | « BUILD.gn ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698