Changeset 87949 in webkit


Ignore:
Timestamp:
Jun 2, 2011 1:20:34 PM (13 years ago)
Author:
alokp@chromium.org
Message:

2011-06-02 Alok Priyadarshi <alokp@chromium.org>

Reviewed by James Robinson.

[chromium] Things jump around when selecting anything on the page
https://bugs.webkit.org/show_bug.cgi?id=61639

WebCore::LayerTextureUpdaterSkPicture::updateTextureRect was not updating a tile sub-region properly.
It did not consider dest-rect when selecting the clip and translation required to draw the content-rect into dest-rect.
Also removed clearing of framebuffer because it used to clear the whole tile not just dest-rect.
An appropriate viewport could be set to just clear the dest-rect, but it was debug only code and I did not want to mess
with the viewport set by skia.

No new tests. This case should be covered by most of the layout tests (pixel) targeting selection or hovering when chromium is run in compositing mode.
Here is a non-exhaustive list of existing tests covering this case.
Test: editing/selection/14971.html (existing)

editing/selection/3690703-2.html (existing)
editing/selection/4402375.html (existing)
editing/selection/4818145.html (existing)

  • platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp: (WebCore::LayerTextureUpdaterSkPicture::updateTextureRect): (WebCore::LayerTextureUpdaterSkPicture::createFrameBuffer):
  • platform/graphics/chromium/LayerTextureUpdaterCanvas.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87948 r87949  
     12011-06-02  Alok Priyadarshi  <alokp@chromium.org>
     2
     3        Reviewed by James Robinson.
     4
     5        [chromium] Things jump around when selecting anything on the page
     6        https://bugs.webkit.org/show_bug.cgi?id=61639
     7
     8        WebCore::LayerTextureUpdaterSkPicture::updateTextureRect was not updating a tile sub-region properly.
     9        It did not consider dest-rect when selecting the clip and translation required to draw the content-rect into dest-rect.
     10        Also removed clearing of framebuffer because it used to clear the whole tile not just dest-rect.
     11        An appropriate viewport could be set to just clear the dest-rect, but it was debug only code and I did not want to mess
     12        with the viewport set by skia.
     13
     14        No new tests. This case should be covered by most of the layout tests (pixel) targeting selection or hovering when chromium is run in compositing mode.
     15        Here is a non-exhaustive list of existing tests covering this case.
     16        Test: editing/selection/14971.html (existing)
     17              editing/selection/3690703-2.html (existing)
     18              editing/selection/4402375.html (existing)
     19              editing/selection/4818145.html (existing)
     20
     21        * platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp:
     22        (WebCore::LayerTextureUpdaterSkPicture::updateTextureRect):
     23        (WebCore::LayerTextureUpdaterSkPicture::createFrameBuffer):
     24        * platform/graphics/chromium/LayerTextureUpdaterCanvas.h:
     25
    1262011-06-02  Dimitri Glazkov  <dglazkov@chromium.org>
    227
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp

    r87365 r87949  
    138138    ASSERT(context()->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) == GraphicsContext3D::FRAMEBUFFER_COMPLETE);
    139139
    140     context()->viewport(0, 0, m_bufferSize.width(), m_bufferSize.height());
    141     clearFrameBuffer();
    142 
    143140    // Notify SKIA to sync its internal GL state.
    144141    m_skiaContext->resetContext();
    145     // Offset from source rectangle to this destination rectangle.
    146     IntPoint offset(sourceRect.x() - contentRect().x(), sourceRect.y() - contentRect().y());
    147142    m_canvas->save();
    148     m_canvas->translate(-offset.x(), -offset.y());
     143    m_canvas->clipRect(SkRect(destRect));
     144    // Translate the origin of contentRect to that of destRect.
     145    // Note that destRect is defined relative to sourceRect.
     146    m_canvas->translate(contentRect().x() - sourceRect.x() + destRect.x(),
     147                        contentRect().y() - sourceRect.y() + destRect.y());
    149148    m_canvas->drawPicture(m_picture);
    150149    m_canvas->restore();
     
    211210    context()->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
    212211    context()->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, Extensions3D::DEPTH24_STENCIL8, m_bufferSize.width(), m_bufferSize.height());
    213     context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
    214     context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
     212    context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
    215213
    216214    // Create a skia gpu canvas.
     
    233231    return true;
    234232}
    235 
    236 void LayerTextureUpdaterSkPicture::clearFrameBuffer()
    237 {
    238 #ifndef NDEBUG
    239     // Clear to green to make it easier to spot unrendered regions.
    240     context()->clearColor(0, 1, 0, 1);
    241     context()->clear(GraphicsContext3D::COLOR_BUFFER_BIT | GraphicsContext3D::STENCIL_BUFFER_BIT);
    242 #endif
    243 }
    244233#endif // SKIA
    245234
  • trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h

    r87365 r87949  
    9292    void deleteFrameBuffer();
    9393    bool createFrameBuffer();
    94     void clearFrameBuffer();
    9594
    9695    GrContext* m_skiaContext; // SKIA graphics context.
Note: See TracChangeset for help on using the changeset viewer.