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

Unified Diff: Source/core/platform/image-decoders/ImageDecoder.h

Issue 23068027: Animated WebP: Optimize decoding in case of seeking (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add_noblend_image
Patch Set: Created 7 years, 4 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 | « no previous file | Source/core/platform/image-decoders/ImageDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/image-decoders/ImageDecoder.h
diff --git a/Source/core/platform/image-decoders/ImageDecoder.h b/Source/core/platform/image-decoders/ImageDecoder.h
index 3c4cc2dc31ae1c33b46c6102351b02b868203354..eee00d4ed5f410bdd3ed2f4707164248020a096a 100644
--- a/Source/core/platform/image-decoders/ImageDecoder.h
+++ b/Source/core/platform/image-decoders/ImageDecoder.h
@@ -64,6 +64,12 @@ namespace WebCore {
DisposeOverwritePrevious // Clear frame to previous framebuffer
// contents
};
+ // Indicates how transparent pixels of the current frame rectangles are
+ // blended with those of the previous frame buffer.
+ enum FrameBlendingMethod {
+ BlendWithPrevious, // Compose the rectangle of current frame by blending it with corresponding pixels in the previous (disposed) framebuffer.
+ BlendOverwrite, // Compose the rectangle of current frame by over-writing the corresponding pixels in the previous (disposed) framebuffer.
+ };
Peter Kasting 2013/08/22 00:08:37 I don't think I really understand what's going on
urvang (Google) 2013/08/22 01:49:36 That's the idea, more of less. To be more precise
typedef uint32_t PixelData;
ImageFrame();
@@ -114,6 +120,7 @@ namespace WebCore {
FrameStatus status() const { return m_status; }
unsigned duration() const { return m_duration; }
FrameDisposalMethod disposalMethod() const { return m_disposalMethod; }
+ FrameBlendingMethod blendingMethod() const { return m_blendingMethod; }
bool premultiplyAlpha() const { return m_premultiplyAlpha; }
SkBitmap::Allocator* allocator() const { return m_allocator; }
const SkBitmap& getSkBitmap() const { return m_bitmap->bitmap(); }
@@ -131,6 +138,7 @@ namespace WebCore {
void setStatus(FrameStatus status);
void setDuration(unsigned duration) { m_duration = duration; }
void setDisposalMethod(FrameDisposalMethod method) { m_disposalMethod = method; }
+ void setBlendingMethod(FrameBlendingMethod method) { m_blendingMethod = method; }
void setPremultiplyAlpha(bool premultiplyAlpha) { m_premultiplyAlpha = premultiplyAlpha; }
void setMemoryAllocator(SkBitmap::Allocator* allocator) { m_allocator = allocator; }
void setSkBitmap(const SkBitmap& bitmap) { m_bitmap = NativeImageSkia::create(bitmap); }
@@ -199,6 +207,7 @@ namespace WebCore {
FrameStatus m_status;
unsigned m_duration;
FrameDisposalMethod m_disposalMethod;
+ FrameBlendingMethod m_blendingMethod;
bool m_premultiplyAlpha;
// The frame that must be decoded before this frame can be decoded.
@@ -383,14 +392,16 @@ namespace WebCore {
if (m_frameBufferCache.isEmpty()) {
m_frameBufferCache.resize(1);
m_frameBufferCache[0].setRequiredPreviousFrameIndex(
- findRequiredPreviousFrame(0));
+ findRequiredPreviousFrame(0, false));
}
m_frameBufferCache[0].setMemoryAllocator(allocator);
}
protected:
// Calculates the most recent frame whose image data may be needed in
- // order to decode frame |frameIndex|, based on frame disposal methods.
+ // order to decode frame |frameIndex|, based on frame disposal methods
+ // and 'frameRectIsOpaque', where 'frameRectIsOpaque' signifies whether
+ // the rectangle of frame at 'frameIndex' is known to be opaque.
// If no previous frame's data is required, returns WTF::notFound.
//
// This function requires that the previous frame's
@@ -404,7 +415,7 @@ namespace WebCore {
// Image formats which do not use more than one frame do not need to
// worry about this; see comments on
// ImageFrame::m_requiredPreviousFrameIndex.
- size_t findRequiredPreviousFrame(size_t frameIndex);
+ size_t findRequiredPreviousFrame(size_t frameIndex, bool frameRectIsOpaque);
virtual void clearFrameBuffer(size_t frameIndex);
« no previous file with comments | « no previous file | Source/core/platform/image-decoders/ImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698