| Differences between
and this patch
- WebCore/ChangeLog +24 lines
Lines 1-3 WebCore/ChangeLog_sec1
1
2009-03-13  Stephen White  <senorblanco@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        https://bugs.webkit.org/show_bug.cgi?id=24584
6
7
        Fix transparent text rendering on Chromium.  FontChromiumWin
8
        was calling beginTransparencyLayer()/endTransparencyLayer(), with
9
        a TransparencyWin inside to do GDI ClearType rendering over an
10
        opaque background.  TransparencyWin does its special sauce
11
        in the destructor, but it was being called too late to be used
12
        correctly in the layer.  Put the special sauce into a new function,
13
        composite(), and call that explicitly instead.
14
15
        * platform/graphics/chromium/FontChromiumWin.cpp:
16
        (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::~TransparencyAwareFontPainter):
17
        * platform/graphics/chromium/TransparencyWin.cpp:
18
        (WebCore::TransparencyWin::~TransparencyWin):
19
        (WebCore::TransparencyWin::composite):
20
        (WebCore::TransparencyWin::init):
21
        * platform/graphics/chromium/TransparencyWin.h:
22
        * rendering/RenderThemeChromiumWin.cpp:
23
        (WebCore::):
24
1
2009-03-13  Dimitri Glazkov  <dglazkov@chromium.org>
25
2009-03-13  Dimitri Glazkov  <dglazkov@chromium.org>
2
26
3
        Reviewed by Timothy Hatcher.
27
        Reviewed by Timothy Hatcher.
- WebCore/platform/graphics/chromium/FontChromiumWin.cpp +1 lines
Lines 186-191 TransparencyAwareFontPainter::~Transpare WebCore/platform/graphics/chromium/FontChromiumWin.cpp_sec1
186
{
186
{
187
    if (!m_useGDI)
187
    if (!m_useGDI)
188
        return;  // Nothing to do.
188
        return;  // Nothing to do.
189
    m_transparency.composite();
189
    if (m_createdTransparencyLayer)
190
    if (m_createdTransparencyLayer)
190
        m_graphicsContext->endTransparencyLayer();
191
        m_graphicsContext->endTransparencyLayer();
191
192
- WebCore/platform/graphics/chromium/TransparencyWin.cpp -2 / +11 lines
Lines 157-166 TransparencyWin::TransparencyWin() WebCore/platform/graphics/chromium/TransparencyWin.cpp_sec1
157
157
158
TransparencyWin::~TransparencyWin()
158
TransparencyWin::~TransparencyWin()
159
{
159
{
160
    // This should be false, since calling composite() is mandatory.
161
    ASSERT(!m_savedOnDrawContext);
162
}
163
164
void TransparencyWin::composite()
165
{
160
    // Matches the save() in initializeNewTextContext (or the constructor for
166
    // Matches the save() in initializeNewTextContext (or the constructor for
161
    // SCALE) to put the context back into the same state we found it.
167
    // SCALE) to put the context back into the same state we found it.
162
    if (m_savedOnDrawContext)
168
    if (m_savedOnDrawContext) {
163
        m_drawContext->restore();
169
        m_drawContext->restore();
170
        m_savedOnDrawContext = false;
171
    }
164
172
165
    switch (m_layerMode) {
173
    switch (m_layerMode) {
166
    case NoLayer:
174
    case NoLayer:
Lines 178-184 TransparencyWin::~TransparencyWin() WebCore/platform/graphics/chromium/TransparencyWin.cpp_sec2
178
void TransparencyWin::init(GraphicsContext* dest,
186
void TransparencyWin::init(GraphicsContext* dest,
179
                           LayerMode layerMode,
187
                           LayerMode layerMode,
180
                           TransformMode transformMode,
188
                           TransformMode transformMode,
181
                           const IntRect& region) {
189
                           const IntRect& region)
190
{
182
    m_destContext = dest;
191
    m_destContext = dest;
183
    m_orgTransform = dest->getCTM();
192
    m_orgTransform = dest->getCTM();
184
    m_layerMode = layerMode;
193
    m_layerMode = layerMode;
- WebCore/platform/graphics/chromium/TransparencyWin.h +3 lines
Lines 134-139 public: WebCore/platform/graphics/chromium/TransparencyWin.h_sec1
134
              TransformMode transformMode,
134
              TransformMode transformMode,
135
              const IntRect& region);
135
              const IntRect& region);
136
136
137
    // Combines the source and destination bitmaps using the given mode.
138
    void composite();
139
137
    // Returns the context for drawing into, which may be the destination
140
    // Returns the context for drawing into, which may be the destination
138
    // context, or a temporary one.
141
    // context, or a temporary one.
139
    GraphicsContext* context() const { return m_drawContext; }
142
    GraphicsContext* context() const { return m_drawContext; }
- WebCore/rendering/RenderThemeChromiumWin.cpp +5 lines
Lines 70-75 public: WebCore/rendering/RenderThemeChromiumWin.cpp_sec1
70
        init(context, getLayerMode(context, transformMode), transformMode, r);
70
        init(context, getLayerMode(context, transformMode), transformMode, r);
71
    }
71
    }
72
72
73
    ~ThemePainter()
74
    {
75
        composite();
76
    }
77
73
private:
78
private:
74
    static LayerMode getLayerMode(GraphicsContext* context, TransformMode transformMode)
79
    static LayerMode getLayerMode(GraphicsContext* context, TransformMode transformMode)
75
    {
80
    {

Return to Bug 24584