Changeset 41692 in webkit


Ignore:
Timestamp:
Mar 13, 2009 3:47:20 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-03-13 Stephen White <senorblanco@chromium.org>

Reviewed by Eric Seidel.

https://bugs.webkit.org/show_bug.cgi?id=24584

Fix transparent text rendering on Chromium. FontChromiumWin
was calling beginTransparencyLayer()/endTransparencyLayer(), with
a TransparencyWin inside to do GDI ClearType rendering over an
opaque background. TransparencyWin does its special sauce
in the destructor, but it was being called too late to be used
correctly in the layer. Put the special sauce into a new function,
composite(), and call that explicitly instead.

  • platform/graphics/chromium/FontChromiumWin.cpp: (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::~TransparencyAwareFontPainter):
  • platform/graphics/chromium/TransparencyWin.cpp: (WebCore::TransparencyWin::~TransparencyWin): (WebCore::TransparencyWin::composite): (WebCore::TransparencyWin::init):
  • platform/graphics/chromium/TransparencyWin.h:
  • rendering/RenderThemeChromiumWin.cpp: (WebCore::):
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r41691 r41692  
     12009-03-13  Stephen White  <senorblanco@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     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
    1252009-03-13  Mike Belshe  <mike@belshe.com>
    226
  • trunk/WebCore/platform/graphics/chromium/FontChromiumWin.cpp

    r41287 r41692  
    187187    if (!m_useGDI)
    188188        return;  // Nothing to do.
     189    m_transparency.composite();
    189190    if (m_createdTransparencyLayer)
    190191        m_graphicsContext->endTransparencyLayer();
  • trunk/WebCore/platform/graphics/chromium/TransparencyWin.cpp

    r41386 r41692  
    158158TransparencyWin::~TransparencyWin()
    159159{
     160    // This should be false, since calling composite() is mandatory.
     161    ASSERT(!m_savedOnDrawContext);
     162}
     163
     164void TransparencyWin::composite()
     165{
    160166    // Matches the save() in initializeNewTextContext (or the constructor for
    161167    // SCALE) to put the context back into the same state we found it.
    162     if (m_savedOnDrawContext)
     168    if (m_savedOnDrawContext) {
    163169        m_drawContext->restore();
     170        m_savedOnDrawContext = false;
     171    }
    164172
    165173    switch (m_layerMode) {
     
    179187                           LayerMode layerMode,
    180188                           TransformMode transformMode,
    181                            const IntRect& region) {
     189                           const IntRect& region)
     190{
    182191    m_destContext = dest;
    183192    m_orgTransform = dest->getCTM();
  • trunk/WebCore/platform/graphics/chromium/TransparencyWin.h

    r41287 r41692  
    135135              const IntRect& region);
    136136
     137    // Combines the source and destination bitmaps using the given mode.
     138    void composite();
     139
    137140    // Returns the context for drawing into, which may be the destination
    138141    // context, or a temporary one.
  • trunk/WebCore/rendering/RenderThemeChromiumWin.cpp

    r41652 r41692  
    7171    }
    7272
     73    ~ThemePainter()
     74    {
     75        composite();
     76    }
     77
    7378private:
    7479    static LayerMode getLayerMode(GraphicsContext* context, TransformMode transformMode)
Note: See TracChangeset for help on using the changeset viewer.