WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Clean up ImageSource.* in preparation for more fixes on bug 27965
patch2 (text/plain), 4.40 KB, created by
Peter Kasting
on 2009-08-27 15:38:57 PDT
(
hide
)
Description:
Clean up ImageSource.* in preparation for more fixes on bug 27965
Filename:
MIME Type:
Creator:
Peter Kasting
Created:
2009-08-27 15:38:57 PDT
Size:
4.40 KB
patch
obsolete
>Index: WebCore/ChangeLog >=================================================================== >--- WebCore/ChangeLog (revision 47838) >+++ WebCore/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2009-08-27 Peter Kasting <pkasting@google.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ https://bugs.webkit.org/show_bug.cgi?id=28751 >+ Clean up ImageSource.* in preparation for more fixes on bug 27965. >+ >+ * platform/graphics/ImageSource.cpp: Put functions in the same order as in header file. >+ (WebCore::ImageSource::isSizeAvailable): Shorten. >+ (WebCore::ImageSource::size): Shorten. >+ (WebCore::ImageSource::frameSizeAtIndex): Shorten. >+ (WebCore::ImageSource::repetitionCount): Shorten. >+ (WebCore::ImageSource::frameIsCompleteAtIndex): >+ * platform/graphics/ImageSource.h: Shorten #ifdef section a bit by sharing common typedefs. >+ > 2009-08-27 Peter Kasting <pkasting@google.com> > > Reviewed by Eric Seidel. >Index: WebCore/platform/graphics/ImageSource.cpp >=================================================================== >--- WebCore/platform/graphics/ImageSource.cpp (revision 47835) >+++ WebCore/platform/graphics/ImageSource.cpp (working copy) >@@ -144,34 +144,22 @@ String ImageSource::filenameExtension() > > bool ImageSource::isSizeAvailable() > { >- if (!m_decoder) >- return false; >- >- return m_decoder->isSizeAvailable(); >+ return m_decoder ? m_decoder->isSizeAvailable() : false; > } > > IntSize ImageSource::size() const > { >- if (!m_decoder) >- return IntSize(); >- >- return m_decoder->size(); >+ return m_decoder ? m_decoder->size() : IntSize(); > } > > IntSize ImageSource::frameSizeAtIndex(size_t index) const > { >- if (!m_decoder) >- return IntSize(); >- >- return m_decoder->frameSizeAtIndex(index); >+ return m_decoder ? frameSizeAtIndex(index) : IntSize(); > } > > int ImageSource::repetitionCount() > { >- if (!m_decoder) >- return cAnimationNone; >- >- return m_decoder->repetitionCount(); >+ return m_decoder ? m_decoder->repetitionCount() : cAnimationNone; > } > > size_t ImageSource::frameCount() const >@@ -198,15 +186,6 @@ NativeImagePtr ImageSource::createFrameA > return buffer->asNewNativeImage(); > } > >-bool ImageSource::frameIsCompleteAtIndex(size_t index) >-{ >- if (!m_decoder) >- return false; >- >- RGBA32Buffer* buffer = m_decoder->frameBufferAtIndex(index); >- return buffer && buffer->status() == RGBA32Buffer::FrameComplete; >-} >- > float ImageSource::frameDurationAtIndex(size_t index) > { > if (!m_decoder) >@@ -237,4 +216,13 @@ bool ImageSource::frameHasAlphaAtIndex(s > m_decoder->frameBufferAtIndex(index)->hasAlpha() : true; > } > >+bool ImageSource::frameIsCompleteAtIndex(size_t index) >+{ >+ if (!m_decoder) >+ return false; >+ >+ RGBA32Buffer* buffer = m_decoder->frameBufferAtIndex(index); >+ return buffer && buffer->status() == RGBA32Buffer::FrameComplete; >+} >+ > } >Index: WebCore/platform/graphics/ImageSource.h >=================================================================== >--- WebCore/platform/graphics/ImageSource.h (revision 47835) >+++ WebCore/platform/graphics/ImageSource.h (working copy) >@@ -59,39 +59,32 @@ class IntSize; > class SharedBuffer; > class String; > >-#if PLATFORM(WX) >-class ImageDecoder; >-typedef ImageDecoder* NativeImageSourcePtr; >-typedef const Vector<char>* NativeBytePtr; >-#if USE(WXGC) >-typedef wxGraphicsBitmap* NativeImagePtr; >-#else >-typedef wxBitmap* NativeImagePtr; >-#endif >-#elif PLATFORM(CG) >+#if PLATFORM(CG) > typedef CGImageSourceRef NativeImageSourcePtr; > typedef CGImageRef NativeImagePtr; > #elif PLATFORM(QT) > class ImageDecoderQt; > typedef ImageDecoderQt* NativeImageSourcePtr; > typedef QPixmap* NativeImagePtr; >-#elif PLATFORM(CAIRO) >+#else > class ImageDecoder; > typedef ImageDecoder* NativeImageSourcePtr; >+#if PLATFORM(WX) >+#if USE(WXGC) >+typedef wxGraphicsBitmap* NativeImagePtr; >+#else >+typedef wxBitmap* NativeImagePtr; >+#endif >+#elif PLATFORM(CAIRO) > typedef cairo_surface_t* NativeImagePtr; > #elif PLATFORM(SKIA) >-class ImageDecoder; >-typedef ImageDecoder* NativeImageSourcePtr; > typedef NativeImageSkia* NativeImagePtr; > #elif PLATFORM(HAIKU) >-class ImageDecoder; >-typedef ImageDecoder* NativeImageSourcePtr; > typedef BBitmap* NativeImagePtr; > #elif PLATFORM(WINCE) >-class ImageDecoder; >-typedef ImageDecoder* NativeImageSourcePtr; > typedef RefPtr<SharedBitmap> NativeImagePtr; > #endif >+#endif > > const int cAnimationLoopOnce = -1; > const int cAnimationNone = -2;
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 28751
:
38641
|
38684
|
38688
|
38689
|
38693
|
38694
|
46606
|
46609
|
46614
|
46709
|
46714
|
48689
|
48690
|
48960