Changeset 83558 in webkit


Ignore:
Timestamp:
Apr 11, 2011 11:03:51 PM (13 years ago)
Author:
vangelis@chromium.org
Message:

2011-04-11 Vangelis Kokkevis <vangelis@chromium.org>

Reviewed by James Robinson.

Adding a test which verifies that compositing image layers
update correctly when their contents change.
https://bugs.webkit.org/show_bug.cgi?id=58181

  • compositing/images/content-image-change-expected.txt: Added.
  • compositing/images/content-image-change.html: Added.
  • platform/chromium/test_expectations.txt:
  • platform/mac/compositing/images/content-image-change-expected.checksum: Added.
  • platform/mac/compositing/images/content-image-change-expected.png: Added.

2011-04-11 Vangelis Kokkevis <vangelis@chromium.org>

Reviewed by James Robinson.

[chromium] Properly invalidate the contents of ImageLayerChromium's
when the actual image contents change.
https://bugs.webkit.org/show_bug.cgi?id=58181

Test: compositing/images/content-image-change.html

  • platform/graphics/chromium/ContentLayerChromium.cpp: (WebCore::ContentLayerChromium::updateTexture):
  • platform/graphics/chromium/ImageLayerChromium.cpp: (WebCore::ImageLayerChromium::ImageLayerChromium): (WebCore::ImageLayerChromium::setContents): (WebCore::ImageLayerChromium::paintContentsIfDirty):
  • platform/graphics/chromium/ImageLayerChromium.h:
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83555 r83558  
     12011-04-11  Vangelis Kokkevis  <vangelis@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        Adding a test which verifies that compositing image layers
     6        update correctly when their contents change.
     7        https://bugs.webkit.org/show_bug.cgi?id=58181
     8
     9        * compositing/images/content-image-change-expected.txt: Added.
     10        * compositing/images/content-image-change.html: Added.
     11        * platform/chromium/test_expectations.txt:
     12        * platform/mac/compositing/images/content-image-change-expected.checksum: Added.
     13        * platform/mac/compositing/images/content-image-change-expected.png: Added.
     14
    1152011-04-11  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r83541 r83558  
    28552855WONTFIX GPU MAC LEOPARD : media = IMAGE PASS
    28562856
     2857// Will need windows and linux baselines
     2858BUGWK58182 GPU : compositing/images/content-image-change.html = PASS FAIL
     2859
    28572860// The picture does not match the video in the test.
    28582861BUGWK55519 GPU WIN LINUX : compositing/video/video-background-color.html = IMAGE+TEXT
  • trunk/Source/WebCore/ChangeLog

    r83555 r83558  
     12011-04-11  Vangelis Kokkevis  <vangelis@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Properly invalidate the contents of ImageLayerChromium's
     6        when the actual image contents change.
     7        https://bugs.webkit.org/show_bug.cgi?id=58181
     8
     9        Test: compositing/images/content-image-change.html
     10
     11        * platform/graphics/chromium/ContentLayerChromium.cpp:
     12        (WebCore::ContentLayerChromium::updateTexture):
     13        * platform/graphics/chromium/ImageLayerChromium.cpp:
     14        (WebCore::ImageLayerChromium::ImageLayerChromium):
     15        (WebCore::ImageLayerChromium::setContents):
     16        (WebCore::ImageLayerChromium::paintContentsIfDirty):
     17        * platform/graphics/chromium/ImageLayerChromium.h:
     18
    1192011-04-11  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp

    r83511 r83558  
    193193        m_uploadUpdateRect = IntRect(IntPoint(0, 0), size);
    194194
     195    if (m_uploadUpdateRect.isEmpty())
     196        return;
     197
    195198    if (!m_contentsTexture->reserve(size, GraphicsContext3D::RGBA)) {
    196199        m_skipsDraw = true;
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp

    r83511 r83558  
    4848ImageLayerChromium::ImageLayerChromium(GraphicsLayerChromium* owner)
    4949    : ContentLayerChromium(owner)
     50    , m_imageForCurrentFrame(0)
    5051    , m_contents(0)
    5152{
     
    5455void ImageLayerChromium::setContents(Image* contents)
    5556{
    56     // Check if the image has changed.
    57     if (m_contents == contents)
     57    // setContents() currently gets called whenever there is any
     58    // style change that affects the layer even if that change doesn't
     59    // affect the actual contents of the image (e.g. a CSS animation).
     60    // With this check in place we avoid unecessary texture uploads.
     61    if ((m_contents == contents) && (m_contents->nativeImageForCurrentFrame() == m_imageForCurrentFrame))
    5862        return;
     63
    5964    m_contents = contents;
     65    m_imageForCurrentFrame = m_contents->nativeImageForCurrentFrame();
     66    m_dirtyRect = IntRect(IntPoint(0, 0), bounds());
    6067    setNeedsDisplay();
    6168}
     
    7380    }
    7481
    75     m_decodedImage.updateFromImage(m_contents->nativeImageForCurrentFrame());
     82    if (!m_dirtyRect.isEmpty()) {
     83        m_decodedImage.updateFromImage(m_contents->nativeImageForCurrentFrame());
     84        m_uploadUpdateRect = IntRect(IntPoint(0, 0), m_decodedImage.size());
     85    }
    7686}
    7787
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h

    r83511 r83558  
    6565
    6666    PlatformImage m_decodedImage;
     67    NativeImagePtr m_imageForCurrentFrame;
    6768    RefPtr<Image> m_contents;
    6869};
Note: See TracChangeset for help on using the changeset viewer.