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

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: Fix a test - we now draw transparent background for missing color table 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
« no previous file with comments | « cmake/CMakeLists.txt ('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 f9c831a9a87f6c69b7c5e711e50369a5331096e6..a021aa93192c35448bf48f5d6928c191a41dac24 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;
}
« no previous file with comments | « cmake/CMakeLists.txt ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698