Changeset 85527 in webkit


Ignore:
Timestamp:
May 2, 2011 3:13:38 PM (13 years ago)
Author:
enne@google.com
Message:

2011-04-27 Adrienne Walker <enne@google.com>

Reviewed by James Robinson.

Add test for multiple invalidations of the same size.
https://bugs.webkit.org/show_bug.cgi?id=58907

This tests a bug in Chromium where canvas state was not being properly
reset between draw calls and a cached canvas of the same size was
being used to paint into that retained incorrect state.

  • compositing/repaint/same-size-invalidation-expected.txt: Added.
  • compositing/repaint/same-size-invalidation.html: Added.
  • platform/chromium-gpu/compositing/repaint/same-size-invalidation-expected.png: Added.

2011-04-19 Adrienne Walker <enne@google.com>

Reviewed by James Robinson.

[chromium] Don't unnecessarily resize skia/cg canvases when painting in compositor
https://bugs.webkit.org/show_bug.cgi?id=58907

Additionally, move the context save/restore logic to a place where it
will reset the translation added in LayerTilerChromium.

Test: compositing/repaint/same-size-invalidation.html

  • platform/graphics/chromium/ContentLayerChromium.cpp: (WebCore::ContentLayerPainter::paint):
  • platform/graphics/chromium/PlatformCanvas.cpp: (WebCore::PlatformCanvas::resize): (WebCore::PlatformCanvas::Painter::Painter): (WebCore::PlatformCanvas::Painter::~Painter):
  • platform/graphics/chromium/PlatformCanvas.h:
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85525 r85527  
     12011-04-27  Adrienne Walker  <enne@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        Add test for multiple invalidations of the same size.
     6        https://bugs.webkit.org/show_bug.cgi?id=58907
     7
     8        This tests a bug in Chromium where canvas state was not being properly
     9        reset between draw calls and a cached canvas of the same size was
     10        being used to paint into that retained incorrect state.
     11
     12        * compositing/repaint/same-size-invalidation-expected.txt: Added.
     13        * compositing/repaint/same-size-invalidation.html: Added.
     14        * platform/chromium-gpu/compositing/repaint/same-size-invalidation-expected.png: Added.
     15
    1162011-05-02  Alpha Lam  <hclam@chromium.org>
    217
  • trunk/Source/WebCore/ChangeLog

    r85526 r85527  
     12011-04-19  Adrienne Walker  <enne@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Don't unnecessarily resize skia/cg canvases when painting in compositor
     6        https://bugs.webkit.org/show_bug.cgi?id=58907
     7
     8        Additionally, move the context save/restore logic to a place where it
     9        will reset the translation added in LayerTilerChromium.
     10
     11        Test: compositing/repaint/same-size-invalidation.html
     12
     13        * platform/graphics/chromium/ContentLayerChromium.cpp:
     14        (WebCore::ContentLayerPainter::paint):
     15        * platform/graphics/chromium/PlatformCanvas.cpp:
     16        (WebCore::PlatformCanvas::resize):
     17        (WebCore::PlatformCanvas::Painter::Painter):
     18        (WebCore::PlatformCanvas::Painter::~Painter):
     19        * platform/graphics/chromium/PlatformCanvas.h:
     20
    1212011-05-02  Csaba Osztrogonác  <ossy@webkit.org>
    222
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r84582 r85527  
    7878    virtual void paint(GraphicsContext& context, const IntRect& contentRect)
    7979    {
    80         context.save();
    8180        context.clearRect(contentRect);
    8281        context.clip(contentRect);
    8382        m_owner->paintGraphicsLayerContents(context, contentRect);
    84         context.restore();
    8583    }
    8684private:
  • trunk/Source/WebCore/platform/graphics/chromium/PlatformCanvas.cpp

    r84101 r85527  
    5151void PlatformCanvas::resize(const IntSize& size)
    5252{
     53    if (m_size == size)
     54        return;
    5355    m_size = size;
    5456#if USE(SKIA)
     
    108110    m_context = adoptPtr(new GraphicsContext(m_contextCG.get()));
    109111#endif
     112    context()->save();
    110113}
    111114
    112115PlatformCanvas::Painter::~Painter()
    113116{
     117    context()->restore();
    114118}
    115119
  • trunk/Source/WebCore/platform/graphics/chromium/PlatformCanvas.h

    r84101 r85527  
    8282
    8383        Painter(PlatformCanvas*, TextOption);
     84        // Destructor restores canvas context to pre-construction state.
    8485        ~Painter();
    8586
Note: See TracChangeset for help on using the changeset viewer.