Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 270151 Details for
Bug 363785
net-libs/webkit-gtk-1.2.7: some gif animations works with artefacts
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
The patch fixes this bug
webkit-gtk-1.2.7-gifanimation.patch (text/plain), 5.40 KB, created by
Taras Gaidukov
on 2011-04-16 05:03:12 UTC
(
hide
)
Description:
The patch fixes this bug
Filename:
MIME Type:
Creator:
Taras Gaidukov
Created:
2011-04-16 05:03:12 UTC
Size:
5.40 KB
patch
obsolete
>--- WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp >+++ WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp >@@ -135,8 +135,7 @@ > // always use ImageSource::clear(true, ...) to completely free the memory in > // this case. > clearBeforeFrame = std::min(clearBeforeFrame, m_frameBufferCache.size() - 1); >- const Vector<RGBA32Buffer>::iterator end(m_frameBufferCache.begin() + clearBeforeFrame); >- >+ > // We need to preserve frames such that: > // * We don't clear |end| > // * We don't clear the frame we're currently decoding >@@ -155,17 +154,17 @@ > // * If the frame is partial, we're decoding it, so don't clear it; if it > // has a disposal method other than DisposeOverwritePrevious, stop > // scanning, as we'll only need this frame when decoding the next one. >- Vector<RGBA32Buffer>::iterator i(end); >- for (; (i != m_frameBufferCache.begin()) && ((i->status() == RGBA32Buffer::FrameEmpty) || (i->disposalMethod() == RGBA32Buffer::DisposeOverwritePrevious)); --i) { >- if ((i->status() == RGBA32Buffer::FrameComplete) && (i != end)) >- i->clear(); >+ size_t i; >+ for (i = clearBeforeFrame; i && ((m_frameBufferCache[i].status() == RGBA32Buffer::FrameEmpty) || (m_frameBufferCache[i].disposalMethod() == RGBA32Buffer::DisposeOverwritePrevious)); --i) { >+ if ((m_frameBufferCache[i].status() == RGBA32Buffer::FrameComplete) && (i != clearBeforeFrame)) >+ m_frameBufferCache[i].clear(); > } > > // Now |i| holds the last frame we need to preserve; clear prior frames. >- for (Vector<RGBA32Buffer>::iterator j(m_frameBufferCache.begin()); j != i; ++j) { >- ASSERT(j->status() != RGBA32Buffer::FramePartial); >- if (j->status() != RGBA32Buffer::FrameEmpty) >- j->clear(); >+ for (size_t j = 0; j != i; ++j) { >+ ASSERT(m_frameBufferCache[j].status() != RGBA32Buffer::FramePartial); >+ if (m_frameBufferCache[j].status() != RGBA32Buffer::FrameEmpty) >+ m_frameBufferCache[j].clear(); > } > } > >@@ -343,7 +342,7 @@ > > if ((prevMethod == RGBA32Buffer::DisposeNotSpecified) || (prevMethod == RGBA32Buffer::DisposeKeep)) { > // Preserve the last frame as the starting state for this frame. >- if (!buffer->copyBitmapData(*prevBuffer)); >+ if (!buffer->copyBitmapData(*prevBuffer)) > return setFailed(); > } else { > // We want to clear the previous frame to transparent, without >@@ -357,7 +356,7 @@ > return setFailed(); > } else { > // Copy the whole previous buffer, then clear just its frame. >- if (!buffer->copyBitmapData(*prevBuffer)); >+ if (!buffer->copyBitmapData(*prevBuffer)) > return setFailed(); > for (int y = prevRect.y(); y < prevRect.bottom(); ++y) { > for (int x = prevRect.x(); x < prevRect.right(); ++x) > >--- WebCore/platform/image-decoders/ImageDecoder.h >+++ WebCore/platform/image-decoders/ImageDecoder.h >@@ -191,6 +191,89 @@ > // initializing the next frame. > }; > >+ class frameBufferCache { >+ public: >+ frameBufferCache() >+ : m_size(0) >+ , m_prev(NULL) >+ , m_next(NULL) >+ { >+ } >+ >+ bool isEmpty() const >+ { >+ return m_size == 0; >+ } >+ >+ const RGBA32Buffer& first() const >+ { >+ return m_buffer; >+ } >+ >+ RGBA32Buffer& first() >+ { >+ return m_buffer; >+ } >+ >+ RGBA32Buffer& operator [] (size_t n) >+ { >+ return getItem(n)->m_buffer; >+ } >+ >+ size_t size() >+ { >+ return m_size; >+ } >+ >+ void resize(size_t sz) >+ { >+ if (sz == m_size) >+ return; >+ >+ frameBufferCache* item = getLastItem(); >+ >+ if (sz > m_size) >+ for (; m_size < sz; m_size++) { >+ item->m_next = new frameBufferCache; >+ item = item->m_next; >+ } >+ else >+ for (; m_size > sz; m_size--) { >+ item = item->m_prev; >+ delete item->m_next; >+ item->m_next = NULL; >+ } >+ } >+ private: >+ frameBufferCache* getItem(size_t n) >+ { >+ frameBufferCache* item = this; >+ >+ for (size_t i = 0; i < n; i++) >+ item = item->m_next; >+ >+ return item; >+ } >+ >+ frameBufferCache* getLastItem() >+ { >+ frameBufferCache* item = this; >+ >+ while (item->m_next) >+ item = item->m_next; >+ >+ return item; >+ } >+ >+ RGBA32Buffer m_buffer; >+ >+ size_t m_size; >+ >+ frameBufferCache* m_next; >+ >+ frameBufferCache* m_prev; >+ }; >+ > // The ImageDecoder class represents a base class for specific image format > // decoders (e.g., GIF, JPG, PNG, ICO) to derive from. All decoders decode > // into RGBA32 format and the base class manages the RGBA32 frame cache. >@@ -325,7 +408,7 @@ > int scaledY(int origY, int searchStart = 0); > > RefPtr<SharedBuffer> m_data; // The encoded data. >- Vector<RGBA32Buffer> m_frameBufferCache; >+ frameBufferCache m_frameBufferCache; > bool m_scaled; > Vector<int> m_scaledColumns; > Vector<int> m_scaledRows;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 363785
: 270151