Commit 204f7105 authored by dglazkov@chromium.org's avatar dglazkov@chromium.org

2010-02-06 Dimitri Glazkov <dglazkov@chromium.org>

        Reviewed by Adam Barth.

        Using inlines and function-level statics don't mix, according to gcc.
        https://bugs.webkit.org/show_bug.cgi?id=34663

        De-inline deviceRGBColorSpaceRef to avoid gcc-bug landmines.

        It appears that the initialization check, generated by gcc doesn't account
        for a possibility that the function may be inlined, resulting in lazy
        initialization failure for more than one inlined instance of the function.

        No behavior change, so no new tests.

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::deviceRGBColorSpaceRef):
        * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:

git-svn-id: svn://svn.chromium.org/blink/trunk@54465 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 44fb4f7d
2010-02-06 Dimitri Glazkov <dglazkov@chromium.org>
Reviewed by Adam Barth.
Using inlines and function-level statics don't mix, according to gcc.
https://bugs.webkit.org/show_bug.cgi?id=34663
De-inline deviceRGBColorSpaceRef to avoid gcc-bug landmines.
It appears that the initialization check, generated by gcc doesn't account
for a possibility that the function may be inlined, resulting in lazy
initialization failure for more than one inlined instance of the function.
No behavior change, so no new tests.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::deviceRGBColorSpaceRef):
* platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
2010-02-05 Geoffrey Garen <ggaren@apple.com>
Reviewed by Dan Bernstein.
......
......@@ -126,6 +126,12 @@ static void setCGStrokeColorSpace(CGContextRef context, ColorSpace colorSpace)
}
}
CGColorSpaceRef deviceRGBColorSpaceRef()
{
static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB();
return deviceSpace;
}
GraphicsContext::GraphicsContext(CGContextRef cgContext)
: m_common(createGraphicsContextPrivate())
, m_data(new GraphicsContextPlatformPrivate(cgContext))
......
......@@ -28,11 +28,7 @@
namespace WebCore {
// FIXME: This would be in GraphicsContextCG.h if that existed.
inline CGColorSpaceRef deviceRGBColorSpaceRef()
{
static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB();
return deviceSpace;
}
CGColorSpaceRef deviceRGBColorSpaceRef();
// FIXME: This would be in GraphicsContextCG.h if that existed.
inline CGColorSpaceRef sRGBColorSpaceRef()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment