Changeset 136056 in webkit


Ignore:
Timestamp:
Nov 28, 2012 2:21:47 PM (11 years ago)
Author:
bfulgham@webkit.org
Message:

[WinCairo] Crash when requesting favicon.
https://bugs.webkit.org/show_bug.cgi?id=102689

Patch by peavo@outlook.com <peavo@outlook.com> on 2012-11-28
Reviewed by Brent Fulgham.

Source/WebCore:

  • platform/graphics/BitmapImage.h: Made frameCount() method virtual, subclasses made for testing can then override it.
  • platform/graphics/win/ImageCairoWin.cpp:

(WebCore::BitmapImage::getHBITMAPOfSize): Added NULL pointer check.
(WebCore::BitmapImage::drawFrameMatchingSourceSize): Added NULL pointer check.

Source/WebKit2:

  • win/WebKit2CFLite.def: Link fixes.
  • win/WebKit2.def: Link fixes.

Tools:

  • TestWebKitAPI/Tests/WebCore/win: Added.
  • TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp: Added.

(TestWebKitAPI::BitmapImageTest::BitmapImageTest): Allocate frame in constructor.
(TestWebKitAPI::BitmapImageTest::frameCount): Override frameCount() method.
(TestWebKitAPI::TEST): Added new test.

  • TestWebKitAPI/config.h: Make sure defines are correct for WinCairo.
    • TestWebKitAPI/win/TestWebKitAPI.vcproj: Added new test.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r136055 r136056  
     12012-11-28  peavo@outlook.com  <peavo@outlook.com>
     2
     3        [WinCairo] Crash when requesting favicon.
     4        https://bugs.webkit.org/show_bug.cgi?id=102689
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * platform/graphics/BitmapImage.h: Made frameCount() method virtual, subclasses made for testing can then override it.
     9        * platform/graphics/win/ImageCairoWin.cpp:
     10        (WebCore::BitmapImage::getHBITMAPOfSize): Added NULL pointer check.
     11        (WebCore::BitmapImage::drawFrameMatchingSourceSize): Added NULL pointer check.
     12
    1132012-11-28  Tony Chang  <tony@chromium.org>
    214
  • trunk/Source/WebCore/platform/graphics/BitmapImage.h

    r134041 r136056  
    219219
    220220    size_t currentFrame() const { return m_currentFrame; }
    221     size_t frameCount();
     221    virtual size_t frameCount();
    222222    NativeImagePtr frameAtIndex(size_t);
    223223    bool frameIsCompleteAtIndex(size_t);
  • trunk/Source/WebCore/platform/graphics/win/ImageCairoWin.cpp

    r135659 r136056  
    6363
    6464    // If this is a 32bpp bitmap, which it always should be, we'll clear it so alpha-wise it will be visible
    65     if (bmpInfo.bmBitsPixel == 32) {
     65    if (bmpInfo.bmBitsPixel == 32 && bmpInfo.bmBits) {
    6666        int bufferSize = bmpInfo.bmWidthBytes * bmpInfo.bmHeight;
    6767        memset(bmpInfo.bmBits, 255, bufferSize);
     
    9696    size_t frames = frameCount();
    9797    for (size_t i = 0; i < frames; ++i) {
    98         cairo_surface_t* image = frameAtIndex(i)->surface();
     98        NativeImageCairo* nativeImage = frameAtIndex(i);
     99        if (!nativeImage)
     100            continue;
     101        cairo_surface_t* image = nativeImage->surface();
    99102        if (!image)
    100103            continue;
  • trunk/Source/WebKit2/ChangeLog

    r136016 r136056  
     12012-11-28  peavo@outlook.com  <peavo@outlook.com>
     2
     3        [WinCairo] Crash when requesting favicon.
     4        https://bugs.webkit.org/show_bug.cgi?id=102689
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * win/WebKit2CFLite.def: Link fixes.
     9        * win/WebKit2.def: Link fixes.
     10
    1112012-11-28  Christophe Dumez  <christophe.dumez@intel.com>
    212
  • trunk/Source/WebKit2/win/WebKit2.def

    r135151 r136056  
    330330        ?trackedRepaintRectsAsText@Frame@WebCore@@QBE?AVString@WTF@@XZ
    331331        ?setTracksRepaints@FrameView@WebCore@@QAEX_N@Z
    332 
     332        ??1BitmapImage@WebCore@@UAE@XZ
     333        ??0BitmapImage@WebCore@@IAE@PAVImageObserver@1@@Z
     334        ?isBitmapImage@BitmapImage@WebCore@@UBE_NXZ
     335        ?currentFrameHasAlpha@BitmapImage@WebCore@@UAE_NXZ
     336        ?hasSingleSecurityOrigin@BitmapImage@WebCore@@UBE_NXZ
     337        ?computeIntrinsicDimensions@Image@WebCore@@UAEXAAULength@2@0AAVFloatSize@2@@Z
     338        ?size@BitmapImage@WebCore@@UBE?AVIntSize@2@XZ
     339        ?getHotSpot@BitmapImage@WebCore@@UBE_NAAVIntPoint@2@@Z
     340        ?dataChanged@BitmapImage@WebCore@@UAE_N_N@Z
     341        ?filenameExtension@BitmapImage@WebCore@@UBE?AVString@WTF@@XZ
     342        ?destroyDecodedData@BitmapImage@WebCore@@MAEX_N@Z
     343        ?decodedSize@BitmapImage@WebCore@@UBEIXZ
     344        ?startAnimation@BitmapImage@WebCore@@MAEX_N@Z
     345        ?stopAnimation@BitmapImage@WebCore@@UAEXXZ
     346        ?resetAnimation@BitmapImage@WebCore@@UAEXXZ
     347        ?nativeImageForCurrentFrame@BitmapImage@WebCore@@UAEPAUCGImage@@XZ
     348        ?getHBITMAP@BitmapImage@WebCore@@UAE_NPAUHBITMAP__@@@Z
     349        ?getHBITMAPOfSize@BitmapImage@WebCore@@UAE_NPAUHBITMAP__@@PAUtagSIZE@@@Z
     350        ?drawPattern@Image@WebCore@@UAEXPAVGraphicsContext@2@ABVFloatRect@2@ABVAffineTransform@2@ABVFloatPoint@2@W4ColorSpace@2@W4CompositeOperator@2@1@Z
     351        ?reportMemoryUsage@BitmapImage@WebCore@@UBEXPAVMemoryObjectInfo@WTF@@@Z
     352        ?drawFrameMatchingSourceSize@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@ABVIntSize@2@W4ColorSpace@2@W4CompositeOperator@2@@Z
     353        ?draw@Image@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4RespectImageOrientationEnum@2@@Z
     354        ?draw@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@@Z
     355        ?mayFillWithSolidColor@BitmapImage@WebCore@@MAE_NXZ
     356        ?solidColor@BitmapImage@WebCore@@MBE?AVColor@2@XZ
     357        ?draw@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4RespectImageOrientationEnum@2@@Z
     358        ?frameCount@BitmapImage@WebCore@@MAEIXZ
     359        ?getCGImageRef@BitmapImage@WebCore@@UAEPAUCGImage@@XZ
     360        ?getFirstCGImageRefOfSize@BitmapImage@WebCore@@UAEPAUCGImage@@ABVIntSize@2@@Z
     361        ?getCGImageArray@BitmapImage@WebCore@@UAE?AV?$RetainPtr@PBU__CFArray@@@WTF@@XZ
     362        ?notSolidColor@BitmapImage@WebCore@@UAE_NXZ
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r135288 r136056  
    321321        ?trackedRepaintRectsAsText@Frame@WebCore@@QBE?AVString@WTF@@XZ
    322322        ?setTracksRepaints@FrameView@WebCore@@QAEX_N@Z
     323        ??1BitmapImage@WebCore@@UAE@XZ
     324        ??0BitmapImage@WebCore@@IAE@PAVImageObserver@1@@Z
     325        ?isBitmapImage@BitmapImage@WebCore@@UBE_NXZ
     326        ?currentFrameHasAlpha@BitmapImage@WebCore@@UAE_NXZ
     327        ?hasSingleSecurityOrigin@BitmapImage@WebCore@@UBE_NXZ
     328        ?computeIntrinsicDimensions@Image@WebCore@@UAEXAAULength@2@0AAVFloatSize@2@@Z
     329        ?size@BitmapImage@WebCore@@UBE?AVIntSize@2@XZ
     330        ?getHotSpot@BitmapImage@WebCore@@UBE_NAAVIntPoint@2@@Z
     331        ?dataChanged@BitmapImage@WebCore@@UAE_N_N@Z
     332        ?filenameExtension@BitmapImage@WebCore@@UBE?AVString@WTF@@XZ
     333        ?destroyDecodedData@BitmapImage@WebCore@@MAEX_N@Z
     334        ?decodedSize@BitmapImage@WebCore@@UBEIXZ
     335        ?startAnimation@BitmapImage@WebCore@@MAEX_N@Z
     336        ?stopAnimation@BitmapImage@WebCore@@UAEXXZ
     337        ?resetAnimation@BitmapImage@WebCore@@UAEXXZ
     338        ?nativeImageForCurrentFrame@BitmapImage@WebCore@@UAEPAVNativeImageCairo@2@XZ
     339        ?getHBITMAP@BitmapImage@WebCore@@UAE_NPAUHBITMAP__@@@Z
     340        ?getHBITMAPOfSize@BitmapImage@WebCore@@UAE_NPAUHBITMAP__@@PAUtagSIZE@@@Z
     341        ?drawPattern@Image@WebCore@@UAEXPAVGraphicsContext@2@ABVFloatRect@2@ABVAffineTransform@2@ABVFloatPoint@2@W4ColorSpace@2@W4CompositeOperator@2@1@Z
     342        ?reportMemoryUsage@BitmapImage@WebCore@@UBEXPAVMemoryObjectInfo@WTF@@@Z
     343        ?drawFrameMatchingSourceSize@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@ABVIntSize@2@W4ColorSpace@2@W4CompositeOperator@2@@Z
     344        ?draw@Image@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4RespectImageOrientationEnum@2@@Z
     345        ?draw@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@@Z
     346        ?mayFillWithSolidColor@BitmapImage@WebCore@@MAE_NXZ
     347        ?solidColor@BitmapImage@WebCore@@MBE?AVColor@2@XZ
     348        ?frameAtIndex@BitmapImage@WebCore@@IAEPAVNativeImageCairo@2@I@Z
     349        ?draw@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4RespectImageOrientationEnum@2@@Z
     350        ?frameCount@BitmapImage@WebCore@@MAEIXZ
     351        ?notSolidColor@BitmapImage@WebCore@@UAE_NXZ
  • trunk/Tools/ChangeLog

    r136051 r136056  
     12012-11-28  peavo@outlook.com  <peavo@outlook.com>
     2
     3        [WinCairo] Crash when requesting favicon.
     4        https://bugs.webkit.org/show_bug.cgi?id=102689
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * TestWebKitAPI/Tests/WebCore/win: Added.
     9        * TestWebKitAPI/Tests/WebCore/win/BitmapImage.cpp: Added.
     10        (TestWebKitAPI::BitmapImageTest::BitmapImageTest): Allocate frame in constructor.
     11        (TestWebKitAPI::BitmapImageTest::frameCount): Override frameCount() method.
     12        (TestWebKitAPI::TEST): Added new test.
     13        * TestWebKitAPI/config.h: Make sure defines are correct for WinCairo.
     14       * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added new test.
     15
    1162012-11-28  Eric Seidel  <eric@webkit.org>
    217
  • trunk/Tools/TestWebKitAPI/config.h

    r126356 r136056  
    4848#endif
    4949
     50#if PLATFORM(WIN_CAIRO)
     51#undef WTF_USE_CG
     52#define WTF_USE_CAIRO 1
     53#define WTF_USE_CURL 1
     54#ifndef _WINSOCKAPI_
     55#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
     56#endif
     57#elif !OS(WINCE)
     58#define WTF_USE_CG 1
     59#undef WTF_USE_CAIRO
     60#undef WTF_USE_CURL
     61#endif
     62
    5063#endif
    5164
  • trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj

    r127001 r136056  
    422422                        >
    423423                        <Filter
     424                                Name="WebCore"
     425                                >
     426                                <Filter
     427                                        Name="win"
     428                                        >
     429                                        <File
     430                                                RelativePath="..\Tests\WebCore\win\BitmapImage.cpp"
     431                                                >
     432                                        </File>
     433                                </Filter>
     434                        </Filter>
     435                        <Filter
    424436                                Name="WebKit2"
    425437                                >
Note: See TracChangeset for help on using the changeset viewer.