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

Unified Diff: Source/core/platform/image-decoders/ImageFrame.cpp

Issue 13980003: Add animation support for WebP images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Create and use zeroFillPixelData() Created 7 years, 6 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
Index: Source/core/platform/image-decoders/ImageFrame.cpp
diff --git a/Source/core/platform/image-decoders/ImageFrame.cpp b/Source/core/platform/image-decoders/ImageFrame.cpp
index c597ccca1ec5ea704358340702488a44a2607f58..a0946e87cbfc1b4c02af09a342876e6c8948d245 100644
--- a/Source/core/platform/image-decoders/ImageFrame.cpp
+++ b/Source/core/platform/image-decoders/ImageFrame.cpp
@@ -152,4 +152,17 @@ void ImageFrame::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
info.addMember(m_bitmap, "bitmap");
}
+void ImageFrame::zeroFillFrameRect(const IntRect& rect)
+{
+ if (rect.isEmpty())
+ return;
+
+ // FIXME: Can we make this faster using Skia?
+ for (int y = rect.y(); y < rect.maxY(); ++y) {
+ uint8_t* const dst = reinterpret_cast<uint8_t*>(getAddr(rect.x(), rect.y()));
+ memset(dst, 0, (rect.maxX() - rect.x()) * sizeof(ImageFrame::PixelData));
+ }
+ setHasAlpha(true);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/platform/image-decoders/ImageDecoderTest.cpp ('k') | Source/core/platform/image-decoders/gif/GIFImageDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698