Fix by Dave MacLachlan, reviewed by Darin and Alexey.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jul 2006 17:26:52 +0000 (17:26 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Jul 2006 17:26:52 +0000 (17:26 +0000)
commit2e6d435a42679ce722f6910b0596905d53c95d49
tree90650e5fde404ec23b6a7c49b4316ed474e54feb
parentd9976e8dd6d4277ddc83dc7546786ae3d1f14a5d
    Fix by Dave MacLachlan, reviewed by Darin and Alexey.

        Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425>
        and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>

        Test: svg/custom/non-opaque-filters.svg

        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
        (WebCore::KCanvasFilterQuartz::prepareFilter):
        We create an autorelease pool so we can control the deallocation of the
        CIContext that we're creating. The CIContext retains the CGContext that
        you pass it internally so when the CIContext is released, the
        CGContext is released as well.
        This is all fine and dandy unless you wrap the creation of the CIFilter
        with a pair of CGBegin/EndTransparencyLayer calls which swap the context
        out from underneath you. So if you start with context A,
        CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
        with it and add a reference to B. CGEndTransparencyLayer swaps out B and
        gives you back A. Autorelease pool comes and cleans up the Filter, and calls
        release on A, but A never got the refcount in the first place. B did. BOOM!
        So we create a pool, then do a retain, then release the pool so that we
        don't have to worry about the pool releasing it at a later time.
        See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/svg/custom/non-opaque-filters-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/non-opaque-filters-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/non-opaque-filters-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/non-opaque-filters.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/kcanvas/device/quartz/KCanvasFilterQuartz.mm