WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-93467-20120808211533.patch (text/plain), 25.52 KB, created by
Dongseong Hwang
on 2012-08-08 05:16:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dongseong Hwang
Created:
2012-08-08 05:16:25 PDT
Size:
25.52 KB
patch
obsolete
>Subversion Revision: 124857 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3cb37e60a95d690d707c459922d83c1e533592f1..c6a2abcc2aebe5b4a91606e0e95b5414f17e524c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,69 @@ > 2012-08-08 Huang Dongsung <luxtella@company100.net> > >+ Change ImageSource to be asynchronous. >+ https://bugs.webkit.org/show_bug.cgi?id=93467 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change makes the API of ImageSource support asynchronous image decoding. This >+ is a preparation for asynchronous image decoding. After ImageSource >+ compelets image decoding, ImageSource sends NativeImagePtr to BitmapImage via >+ ImageSourceObserver::didDecodeFrameAtIndex(). >+ >+ This patch renames createFrameAtIndex to requestFrameAtIndex, to imply >+ this method can be asynchrous. If ImageSource has ImageSourceObserver, this >+ method sends the result via didDecodeFrameAtIndex() either synchronously or >+ asynchronously. Otherwise, this method returns the result synchronously. >+ e.g. GraphicsContext3D calls requestFrameAtIndex without ImageSourceObserver. >+ >+ No new tests - existing image tests cover these cases. >+ >+ * GNUmakefile.list.am: >+ * Target.pri: >+ * WebCore.gypi: >+ * WebCore.vcproj/WebCore.vcproj: >+ * WebCore.xcodeproj/project.pbxproj: >+ * platform/graphics/BitmapImage.cpp: >+ (WebCore::BitmapImage::BitmapImage): >+ (WebCore::BitmapImage::cacheFrame): >+ (WebCore): >+ (WebCore::BitmapImage::didDecodeFrameAtIndex): >+ * platform/graphics/BitmapImage.h: >+ (BitmapImage): >+ * platform/graphics/ImageSource.cpp: >+ (WebCore::ImageSource::ImageSource): >+ (WebCore): >+ (WebCore::ImageSource::requestFrameAtIndex): >+ * platform/graphics/ImageSource.h: >+ (WebCore): >+ (ImageSource): >+ * platform/graphics/ImageSourceObserver.h: Added. >+ (WebCore): >+ (ImageSourceObserver): >+ (WebCore::ImageSourceObserver::~ImageSourceObserver): >+ * platform/graphics/cairo/BitmapImageCairo.cpp: >+ (WebCore::BitmapImage::BitmapImage): >+ * platform/graphics/cairo/GraphicsContext3DCairo.cpp: >+ (WebCore::GraphicsContext3D::getImageData): >+ * platform/graphics/cg/GraphicsContext3DCG.cpp: >+ (WebCore::GraphicsContext3D::getImageData): >+ * platform/graphics/cg/ImageCG.cpp: >+ (WebCore::BitmapImage::BitmapImage): >+ * platform/graphics/cg/ImageSourceCG.cpp: >+ (WebCore::ImageSource::ImageSource): >+ (WebCore): >+ (WebCore::ImageSource::requestFrameAtIndex): >+ * platform/graphics/openvg/ImageOpenVG.cpp: >+ (WebCore::BitmapImage::BitmapImage): >+ * platform/graphics/qt/ImageQt.cpp: >+ (WebCore::BitmapImage::BitmapImage): >+ * platform/graphics/skia/GraphicsContext3DSkia.cpp: >+ (WebCore::GraphicsContext3D::getImageData): >+ * platform/graphics/wx/ImageWx.cpp: >+ (WebCore::BitmapImage::BitmapImage): >+ >+2012-08-08 Huang Dongsung <luxtella@company100.net> >+ > Extract the definition of NativeImagePtr from ImageSource.h into NativeImagePtr.h. > https://bugs.webkit.org/show_bug.cgi?id=93466 > >diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog >index 143ef002be45a5d2523bc6a938f8bbde0845f070..b4765569a2854d1fd95a9d1a77b4e087315b1c98 100644 >--- a/Source/WebKit/chromium/ChangeLog >+++ b/Source/WebKit/chromium/ChangeLog >@@ -1,3 +1,17 @@ >+2012-08-08 Huang Dongsung <luxtella@company100.net> >+ >+ Change ImageSource to be asynchronous. >+ https://bugs.webkit.org/show_bug.cgi?id=93467 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch replaced ImageSource::createFrameAtIndex to >+ ImageSource::requestFrameAtIndex, so I amended WebImageSkia to use >+ changed ImageSource correctly. >+ >+ * src/WebImageSkia.cpp: >+ (WebKit::WebImage::fromData): >+ > 2012-08-06 Yuta Kitamura <yutak@chromium.org> > > WebSocket.send() should accept ArrayBufferView >diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am >index df22101e48d2a75c0a47d61f2e9172e95de45e56..88ae0b8ccf0ab90683c29d502b1a4a4e5648365a 100644 >--- a/Source/WebCore/GNUmakefile.list.am >+++ b/Source/WebCore/GNUmakefile.list.am >@@ -3412,6 +3412,7 @@ webcore_sources += \ > Source/WebCore/platform/graphics/ImageOrientation.h \ > Source/WebCore/platform/graphics/ImageSource.cpp \ > Source/WebCore/platform/graphics/ImageSource.h \ >+ Source/WebCore/platform/graphics/ImageSourceObserver.h \ > Source/WebCore/platform/graphics/IntPoint.h \ > Source/WebCore/platform/graphics/IntPointHash.h \ > Source/WebCore/platform/graphics/IntRect.cpp \ >diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri >index d5b6d6f4eeb56e3bac7c8a61569f1c0e767caa15..9ad46ffbfb40c4afe701597c40e21b71235b91a9 100644 >--- a/Source/WebCore/Target.pri >+++ b/Source/WebCore/Target.pri >@@ -2099,6 +2099,7 @@ HEADERS += \ > platform/graphics/Image.h \ > platform/graphics/ImageOrientation.h \ > platform/graphics/ImageSource.h \ >+ platform/graphics/ImageSourceObserver.h \ > platform/graphics/IntPoint.h \ > platform/graphics/IntPointHash.h \ > platform/graphics/IntRect.h \ >diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi >index 753702c3299a94f7a1fdff959e4158ba646130f8..354d835e94eb11218cd99db50306c68472d7ee80 100644 >--- a/Source/WebCore/WebCore.gypi >+++ b/Source/WebCore/WebCore.gypi >@@ -389,6 +389,7 @@ > 'platform/graphics/ImageObserver.h', > 'platform/graphics/ImageOrientation.h', > 'platform/graphics/ImageSource.h', >+ 'platform/graphics/ImageSourceObserver.h', > 'platform/graphics/IntPoint.h', > 'platform/graphics/IntPointHash.h', > 'platform/graphics/IntRect.h', >diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj >index d4e3c24b46a7d268a4b615846a16cfaaf99b1337..dc459b2e3107d236328c969d662139fb1eaa4873 100755 >--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj >+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj >@@ -29506,6 +29506,10 @@ > > > </File> > <File >+ RelativePath="..\platform\graphics\ImageSourceObserver.h" >+ > >+ </File> >+ <File > RelativePath="..\platform\graphics\IntPoint.h" > > > </File> >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 1d6672c5ed082291d67acb312c34b84a32ce4729..235e50539852eceefd39314fe82e43b1748c4853 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -4828,6 +4828,7 @@ > B275356F0B053814002CE64F /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535410B053814002CE64F /* Image.cpp */; }; > B27535700B053814002CE64F /* Image.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535420B053814002CE64F /* Image.h */; settings = {ATTRIBUTES = (Private, ); }; }; > B27535710B053814002CE64F /* ImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535430B053814002CE64F /* ImageSource.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ B27535710B053814002CE64E /* ImageSourceObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535430B053814002CE64E /* ImageSourceObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; > B27535720B053814002CE64F /* IntPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535440B053814002CE64F /* IntPoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; > B27535730B053814002CE64F /* IntRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27535450B053814002CE64F /* IntRect.cpp */; }; > B27535740B053814002CE64F /* IntRect.h in Headers */ = {isa = PBXBuildFile; fileRef = B27535460B053814002CE64F /* IntRect.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -12063,6 +12064,7 @@ > B27535410B053814002CE64F /* Image.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Image.cpp; sourceTree = "<group>"; }; > B27535420B053814002CE64F /* Image.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Image.h; sourceTree = "<group>"; }; > B27535430B053814002CE64F /* ImageSource.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageSource.h; sourceTree = "<group>"; }; >+ B27535430B053814002CE64E /* ImageSourceObserver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageSourceObserver.h; sourceTree = "<group>"; }; > B27535440B053814002CE64F /* IntPoint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntPoint.h; sourceTree = "<group>"; }; > B27535450B053814002CE64F /* IntRect.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IntRect.cpp; sourceTree = "<group>"; }; > B27535460B053814002CE64F /* IntRect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IntRect.h; sourceTree = "<group>"; }; >@@ -19816,6 +19818,7 @@ > A8748D6612CC3763001FBA41 /* ImageOrientation.h */, > 49291E4A134172C800E753DE /* ImageRenderingMode.h */, > B27535430B053814002CE64F /* ImageSource.h */, >+ B27535430B053814002CE64E /* ImageSourceObserver.h */, > B27535440B053814002CE64F /* IntPoint.h */, > E462A4A0113E71BE004A4220 /* IntPointHash.h */, > B27535450B053814002CE64F /* IntRect.cpp */, >@@ -23582,6 +23585,7 @@ > 2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */, > 49291E4B134172C800E753DE /* ImageRenderingMode.h in Headers */, > B27535710B053814002CE64F /* ImageSource.h in Headers */, >+ B27535710B053814002CE64E /* ImageSourceObserver.h in Headers */, > 4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */, > 316FE1180E6E1DA700BF6088 /* ImplicitAnimation.h in Headers */, > DB23C2CC0A508D29002489EB /* IndentOutdentCommand.h in Headers */, >diff --git a/Source/WebCore/platform/graphics/BitmapImage.cpp b/Source/WebCore/platform/graphics/BitmapImage.cpp >index 368af8722e9ff70708cc85e201fc6a1140651030..1ea08151e7719da38e131d96f9bce42f9f8db678 100644 >--- a/Source/WebCore/platform/graphics/BitmapImage.cpp >+++ b/Source/WebCore/platform/graphics/BitmapImage.cpp >@@ -45,6 +45,7 @@ static int frameBytes(const IntSize& frameSize) > > BitmapImage::BitmapImage(ImageObserver* observer) > : Image(observer) >+ , m_source(this) > , m_currentFrame(0) > , m_frames(0) > , m_frameTimer(0) >@@ -129,12 +130,17 @@ void BitmapImage::destroyMetadataAndNotify(int framesCleared) > void BitmapImage::cacheFrame(size_t index) > { > size_t numFrames = frameCount(); >- ASSERT(m_decodedSize == 0 || numFrames > 1); >- > if (m_frames.size() < numFrames) > m_frames.grow(numFrames); > >- m_frames[index].m_frame = m_source.createFrameAtIndex(index); >+ m_source.requestFrameAtIndex(index); >+} >+ >+void BitmapImage::didDecodeFrameAtIndex(size_t index, NativeImagePtr nativeImage) >+{ >+ m_frames[index].m_frame = nativeImage; >+ >+ size_t numFrames = frameCount(); > if (numFrames == 1 && m_frames[index].m_frame) > checkForSolidColor(); > >diff --git a/Source/WebCore/platform/graphics/BitmapImage.h b/Source/WebCore/platform/graphics/BitmapImage.h >index 6be9761c72292a5e88a27895154692467ee48254..896c92e7c7d37ffa653b6c96b68da13227b1138c 100644 >--- a/Source/WebCore/platform/graphics/BitmapImage.h >+++ b/Source/WebCore/platform/graphics/BitmapImage.h >@@ -32,6 +32,7 @@ > #include "Color.h" > #include "ImageOrientation.h" > #include "ImageSource.h" >+#include "ImageSourceObserver.h" > #include "IntSize.h" > > #if PLATFORM(MAC) >@@ -99,7 +100,7 @@ public: > // BitmapImage Class > // ================================================= > >-class BitmapImage : public Image { >+class BitmapImage : public Image, public ImageSourceObserver { > friend class GeneratedImage; > friend class CrossfadeGeneratedImage; > friend class GeneratorGeneratedImage; >@@ -180,6 +181,9 @@ public: > virtual bool notSolidColor(); > #endif > >+ // ImageSourceObserver >+ virtual void didDecodeFrameAtIndex(size_t, NativeImagePtr); >+ > private: > void updateSize() const; > >diff --git a/Source/WebCore/platform/graphics/ImageSource.cpp b/Source/WebCore/platform/graphics/ImageSource.cpp >index 1154594916a6e62fadd8688d1c3267715f9a5d53..40d261d622d35a4cf538efecdc37498fde4a6a4d 100644 >--- a/Source/WebCore/platform/graphics/ImageSource.cpp >+++ b/Source/WebCore/platform/graphics/ImageSource.cpp >@@ -32,6 +32,7 @@ > #include "ImageDecoder.h" > > #include "ImageOrientation.h" >+#include "ImageSourceObserver.h" > #include "NotImplemented.h" > > namespace WebCore { >@@ -42,6 +43,15 @@ unsigned ImageSource::s_maxPixelsPerDecodedImage = 1024 * 1024; > > ImageSource::ImageSource(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption) > : m_decoder(0) >+ , m_observer(0) >+ , m_alphaOption(alphaOption) >+ , m_gammaAndColorProfileOption(gammaAndColorProfileOption) >+{ >+} >+ >+ImageSource::ImageSource(ImageSourceObserver* observer, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption) >+ : m_decoder(0) >+ , m_observer(observer) > , m_alphaOption(alphaOption) > , m_gammaAndColorProfileOption(gammaAndColorProfileOption) > { >@@ -137,6 +147,15 @@ size_t ImageSource::frameCount() const > return m_decoder ? m_decoder->frameCount() : 0; > } > >+NativeImagePtr ImageSource::requestFrameAtIndex(size_t index) >+{ >+ // TODO: Implement asynchronous decoding. >+ NativeImagePtr nativeImage = createFrameAtIndex(index); >+ if (m_observer) >+ m_observer->didDecodeFrameAtIndex(index, nativeImage); >+ return nativeImage; >+} >+ > NativeImagePtr ImageSource::createFrameAtIndex(size_t index) > { > if (!m_decoder) >diff --git a/Source/WebCore/platform/graphics/ImageSource.h b/Source/WebCore/platform/graphics/ImageSource.h >index 411a2e76bfadfbbbeb0714933e48ea033710bd9c..cce74b5f349c2030506e0be2a2665c38eae46a0a 100644 >--- a/Source/WebCore/platform/graphics/ImageSource.h >+++ b/Source/WebCore/platform/graphics/ImageSource.h >@@ -42,6 +42,7 @@ typedef const struct __CFData* CFDataRef; > namespace WebCore { > > class ImageOrientation; >+class ImageSourceObserver; > class IntPoint; > class IntSize; > class SharedBuffer; >@@ -92,6 +93,7 @@ public: > #endif > > ImageSource(AlphaOption alphaOption = AlphaPremultiplied, GammaAndColorProfileOption gammaAndColorProfileOption = GammaAndColorProfileApplied); >+ ImageSource(ImageSourceObserver*, AlphaOption = AlphaPremultiplied, GammaAndColorProfileOption = GammaAndColorProfileApplied); > ~ImageSource(); > > // Tells the ImageSource that the Image no longer cares about decoded frame >@@ -137,9 +139,11 @@ public: > > size_t frameCount() const; > >- // Callers should not call this after calling clear() with a higher index; >+ // NOTE: Callers should not call this after calling clear() with a higher index; > // see comments on clear() above. >- NativeImagePtr createFrameAtIndex(size_t); >+ // NOTE: If ImageSource has ImageSourceObserver, this method sends the result via didDecodeFrameAtIndex(). >+ // Otherwise, this method returns the result. e.g. GraphicsContext3D >+ NativeImagePtr requestFrameAtIndex(size_t); > > float frameDurationAtIndexDecodingIfNecessary(size_t); > bool frameHasAlphaAtIndex(size_t); // Whether or not the frame actually used any alpha. >@@ -152,7 +156,10 @@ public: > #endif > > private: >+ NativeImagePtr createFrameAtIndex(size_t); >+ > NativeImageSourcePtr m_decoder; >+ ImageSourceObserver* m_observer; > AlphaOption m_alphaOption; > GammaAndColorProfileOption m_gammaAndColorProfileOption; > #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) >diff --git a/Source/WebCore/platform/graphics/ImageSourceObserver.h b/Source/WebCore/platform/graphics/ImageSourceObserver.h >new file mode 100644 >index 0000000000000000000000000000000000000000..15158261e0fa2a411074f34324aee659d7e6bfea >--- /dev/null >+++ b/Source/WebCore/platform/graphics/ImageSourceObserver.h >@@ -0,0 +1,44 @@ >+/* >+ * Copyright (C) 2012 Company 100 Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef ImageSourceObserver_h >+#define ImageSourceObserver_h >+ >+#include "NativeImagePtr.h" >+ >+namespace WebCore { >+ >+// Interface for notification about changes to an ImageSource, including decoding. >+class ImageSourceObserver { >+public: >+ virtual void didDecodeFrameAtIndex(size_t, NativeImagePtr) = 0; >+ >+protected: >+ virtual ~ImageSourceObserver() { } >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp b/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp >index 45850a803aa4d00fa67104287ab7d539983c68c6..c115a9e57cc6b0b3b6e71ae7adbdfa8c2ec67730 100644 >--- a/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp >@@ -42,6 +42,7 @@ PassRefPtr<BitmapImage> BitmapImage::create(cairo_surface_t* surface) > > BitmapImage::BitmapImage(NativeImageCairo* nativeImage, ImageObserver* observer) > : Image(observer) >+ , m_source(this) > , m_currentFrame(0) > , m_frames(0) > , m_frameTimer(0) >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp >index cf46c833d0e0deff1a6d43ef3d7aecdeb6376f97..22d4cb61fd2ddbfdf6909bd229ce22a1a4b4e016 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp >@@ -165,7 +165,7 @@ bool GraphicsContext3D::getImageData(Image* image, unsigned int format, unsigned > decoder.setData(image->data(), true); > if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndexDecodingIfNecessary(0)) > return false; >- OwnPtr<NativeImageCairo> nativeImage = adoptPtr(decoder.createFrameAtIndex(0)); >+ OwnPtr<NativeImageCairo> nativeImage = adoptPtr(decoder.requestFrameAtIndex(0)); > imageSurface = nativeImage->surface(); > } else { > imageSurface = image->nativeImageForCurrentFrame()->surface(); >diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp >index 50de51f4792778e6b359bdf69b3fc94ddb98a862..97453aa32809116e2208a0cd1ed0f72c8ef7b898 100644 >--- a/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp >@@ -107,7 +107,7 @@ bool GraphicsContext3D::getImageData(Image* image, > decoder.setData(image->data(), true); > if (!decoder.frameCount()) > return false; >- decodedImage.adoptCF(decoder.createFrameAtIndex(0)); >+ decodedImage.adoptCF(decoder.requestFrameAtIndex(0)); > cgImage = decodedImage.get(); > } else > cgImage = image->nativeImageForCurrentFrame(); >diff --git a/Source/WebCore/platform/graphics/cg/ImageCG.cpp b/Source/WebCore/platform/graphics/cg/ImageCG.cpp >index f532037d5614484a0497d7f997e85c23cf8c2bf2..c430c4d0b9b6274f47c824a3e571041da0dda313 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/ImageCG.cpp >@@ -70,6 +70,7 @@ bool FrameData::clear(bool clearMetadata) > > BitmapImage::BitmapImage(CGImageRef cgImage, ImageObserver* observer) > : Image(observer) >+ , m_source(this) > , m_currentFrame(0) > , m_frames(0) > , m_frameTimer(0) >diff --git a/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp b/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp >index 76afb8ca052999b911cfab813ad8bc5cd366766e..134c8954b8e2eee8a4133f074eb7d741c28bfccb 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp >@@ -30,6 +30,7 @@ > #include "ImageSourceCG.h" > > #include "ImageOrientation.h" >+#include "ImageSourceObserver.h" > #include "IntPoint.h" > #include "IntSize.h" > #include "MIMETypeRegistry.h" >@@ -72,6 +73,16 @@ void sharedBufferRelease(void* info) > > ImageSource::ImageSource(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption) > : m_decoder(0) >+ , m_observer(0) >+ // FIXME: m_premultiplyAlpha is ignored in cg at the moment. >+ , m_alphaOption(alphaOption) >+ , m_gammaAndColorProfileOption(gammaAndColorProfileOption) >+{ >+} >+ >+ImageSource::ImageSource(ImageSourceObserver* observer, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption) >+ : m_decoder(0) >+ , m_observer(observer) > // FIXME: m_premultiplyAlpha is ignored in cg at the moment. > , m_alphaOption(alphaOption) > , m_gammaAndColorProfileOption(gammaAndColorProfileOption) >@@ -299,6 +310,14 @@ size_t ImageSource::frameCount() const > return m_decoder ? CGImageSourceGetCount(m_decoder) : 0; > } > >+CGImageRef ImageSource::requestFrameAtIndex(size_t index) >+{ >+ CGImageRef imageRef = createFrameAtIndex(index); >+ if (m_observer) >+ m_observer->didDecodeFrameAtIndex(index, imageRef); >+ return imageRef; >+} >+ > CGImageRef ImageSource::createFrameAtIndex(size_t index) > { > if (!initialized()) >diff --git a/Source/WebCore/platform/graphics/openvg/ImageOpenVG.cpp b/Source/WebCore/platform/graphics/openvg/ImageOpenVG.cpp >index 9510882cc85440654a9de0ba18dd7f4a19f20f09..eb8066c474003eca81f0e172f7afda49d6074fa3 100644 >--- a/Source/WebCore/platform/graphics/openvg/ImageOpenVG.cpp >+++ b/Source/WebCore/platform/graphics/openvg/ImageOpenVG.cpp >@@ -52,6 +52,7 @@ bool FrameData::clear(bool clearMetadata) > > BitmapImage::BitmapImage(TiledImageOpenVG* tiledImage, ImageObserver* observer) > : Image(observer) >+ , m_source(this) > , m_size(tiledImage->size()) > , m_currentFrame(0) > , m_frames(1) >diff --git a/Source/WebCore/platform/graphics/qt/ImageQt.cpp b/Source/WebCore/platform/graphics/qt/ImageQt.cpp >index 7864e9f68f65a7933486d855cf52e50fbe5f0b18..51d6c12ca41b26629406945cc73a6532f88d3fda 100644 >--- a/Source/WebCore/platform/graphics/qt/ImageQt.cpp >+++ b/Source/WebCore/platform/graphics/qt/ImageQt.cpp >@@ -201,6 +201,7 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const > > BitmapImage::BitmapImage(QImage* image, ImageObserver* observer) > : Image(observer) >+ , m_source(this) > , m_currentFrame(0) > , m_frames(0) > , m_frameTimer(0) >diff --git a/Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp >index 850caabd888d8c9182e2b09d0572e2f171238d65..6d5f7d1a8cb133705fee4cc3cf360826558c3a76 100644 >--- a/Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp >+++ b/Source/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp >@@ -63,7 +63,7 @@ bool GraphicsContext3D::getImageData(Image* image, > if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndexDecodingIfNecessary(0)) > return false; > hasAlpha = decoder.frameHasAlphaAtIndex(0); >- pixels = adoptPtr(decoder.createFrameAtIndex(0)); >+ pixels = adoptPtr(decoder.requestFrameAtIndex(0)); > if (!pixels.get() || !pixels->isDataComplete() || !pixels->bitmap().width() || !pixels->bitmap().height()) > return false; > SkBitmap::Config skiaConfig = pixels->bitmap().config(); >diff --git a/Source/WebCore/platform/graphics/wx/ImageWx.cpp b/Source/WebCore/platform/graphics/wx/ImageWx.cpp >index d7d0a0f0dda77e343860457e4ea28c28099771cf..8356418ef884b45bfd8aaee8fd36c43062841dfd 100644 >--- a/Source/WebCore/platform/graphics/wx/ImageWx.cpp >+++ b/Source/WebCore/platform/graphics/wx/ImageWx.cpp >@@ -82,6 +82,7 @@ PassRefPtr<Image> Image::loadPlatformResource(const char *name) > > BitmapImage::BitmapImage(const wxBitmap& bitmap) > : Image(0) >+ , m_source(this) > , m_currentFrame(0) > , m_frames(0) > , m_frameTimer(0) >diff --git a/Source/WebKit/chromium/src/WebImageSkia.cpp b/Source/WebKit/chromium/src/WebImageSkia.cpp >index e1a9260506281d89a28fa0cd24033d03971805c7..2d4312b694624d50f1c880b8414d5f2560bfeb3e 100644 >--- a/Source/WebKit/chromium/src/WebImageSkia.cpp >+++ b/Source/WebKit/chromium/src/WebImageSkia.cpp >@@ -79,7 +79,7 @@ WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize) > } > } > >- OwnPtr<NativeImageSkia> frame = adoptPtr(source.createFrameAtIndex(index)); >+ OwnPtr<NativeImageSkia> frame = adoptPtr(source.requestFrameAtIndex(index)); > if (!frame) > return WebImage(); >
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
|
Formatted Diff
|
Diff
Attachments on
bug 93467
:
157190
|
157406
|
157681
|
157706
|
158682
|
158695