Changeset 120344 in webkit


Ignore:
Timestamp:
Jun 14, 2012, 11:33:03 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[Chromium] webkitImageSmoothingEnabled canvas property does not work on redraw
https://bugs.webkit.org/show_bug.cgi?id=89018

Patch by Justin Novosad <junov@chromium.org> on 2012-06-14
Reviewed by Stephen White.

Source/WebCore:

Test: fast/canvas/canvas-imageSmoothingEnabled-repaint.html

When an accelerated canvas layer prepares its texture for the
compositor, it must send a notification to skia to invalidate texture
proprties that are cached by skia, since the compositor may modify them.
The use case this fixes is when a canvas to canvas copy is performed
with webkitImageSmoothingEnabled=false on the destination canvas.
The backing texture of the source canvas will be set to "nearest"
filtering by skia in order to perform the copy. Then, the compositor
sets filtering back to "linear" when the source canvas is drawn.
Skia is designed to only update GL attributes when required, so errors
occur when the skia-side GL state cache is out of sync.

  • platform/graphics/chromium/Canvas2DLayerBridge.cpp:

(WebCore::Canvas2DLayerBridge::prepareTexture):

Source/WebKit/chromium:

Rolling chromium DEPS to 141884

  • DEPS:

LayoutTests:

New layout test that verifies that disabling image smoothing on a 2d
canvas continues to work after multiple paint cycles.

  • fast/canvas/canvas-imageSmoothingEnabled-repaint-expected.txt: Added.
  • fast/canvas/canvas-imageSmoothingEnabled-repaint.html: Added.
  • fast/canvas/script-tests/canvas-imageSmoothingEnabled-repaint.js: Added.

(draw):
(testResult):
(TestControllerPaint):
(BrowserPaint):
(onLoadHandler):

Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r120343 r120344  
     12012-06-14  Justin Novosad  <junov@chromium.org>
     2
     3        [Chromium] webkitImageSmoothingEnabled canvas property does not work on redraw
     4        https://bugs.webkit.org/show_bug.cgi?id=89018
     5
     6        Reviewed by Stephen White.
     7
     8        New layout test that verifies that disabling image smoothing on a 2d
     9        canvas continues to work after multiple paint cycles.
     10
     11        * fast/canvas/canvas-imageSmoothingEnabled-repaint-expected.txt: Added.
     12        * fast/canvas/canvas-imageSmoothingEnabled-repaint.html: Added.
     13        * fast/canvas/script-tests/canvas-imageSmoothingEnabled-repaint.js: Added.
     14        (draw):
     15        (testResult):
     16        (TestControllerPaint):
     17        (BrowserPaint):
     18        (onLoadHandler):
     19
    1202012-06-14  Stephen Chenney  <schenney@chromium.org>
    221
  • trunk/Source/WebCore/ChangeLog

    r120341 r120344  
     12012-06-14  Justin Novosad  <junov@chromium.org>
     2
     3        [Chromium] webkitImageSmoothingEnabled canvas property does not work on redraw
     4        https://bugs.webkit.org/show_bug.cgi?id=89018
     5
     6        Reviewed by Stephen White.
     7
     8        Test: fast/canvas/canvas-imageSmoothingEnabled-repaint.html
     9
     10        When an accelerated canvas layer prepares its texture for the
     11        compositor, it must send a notification to skia to invalidate texture
     12        proprties that are cached by skia, since the compositor may modify them.
     13        The use case this fixes is when a canvas to canvas copy is performed
     14        with webkitImageSmoothingEnabled=false on the destination canvas.
     15        The backing texture of the source canvas will be set to "nearest"
     16        filtering by skia in order to perform the copy.  Then, the compositor
     17        sets filtering back to "linear" when the source canvas is drawn.
     18        Skia is designed to only update GL attributes when required, so errors
     19        occur when the skia-side GL state cache is out of sync.
     20
     21        * platform/graphics/chromium/Canvas2DLayerBridge.cpp:
     22        (WebCore::Canvas2DLayerBridge::prepareTexture):
     23
    1242012-06-14  Jon Honeycutt  <jhoneycutt@apple.com>
    225
  • trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerBridge.cpp

    r120142 r120344  
    142142    }
    143143
     144    if (m_canvas) {
     145        // Notify skia that the state of the backing store texture object will be touched by the compositor
     146        GrRenderTarget* renderTarget = reinterpret_cast<GrRenderTarget*>(m_canvas->getDevice()->accessRenderTarget());
     147        if (renderTarget)
     148            renderTarget->asTexture()->invalidateCachedState();
     149    }
    144150    return m_backBufferTexture;
    145151}
  • trunk/Source/WebKit/chromium/ChangeLog

    r120324 r120344  
     12012-06-14  Justin Novosad  <junov@chromium.org>
     2
     3        [Chromium] webkitImageSmoothingEnabled canvas property does not work on redraw
     4        https://bugs.webkit.org/show_bug.cgi?id=89018
     5
     6        Reviewed by Stephen White.
     7
     8        Rolling chromium DEPS to 141884
     9
     10        * DEPS:
     11
    1122012-06-14  Alexander Pavlov  <apavlov@chromium.org>
    213
  • trunk/Source/WebKit/chromium/DEPS

    r120161 r120344  
    3333vars = {
    3434  'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
    35   'chromium_rev': '141410'
     35  'chromium_rev': '141884'
    3636}
    3737
Note: See TracChangeset for help on using the changeset viewer.