Changeset 65020 in webkit


Ignore:
Timestamp:
Aug 9, 2010 5:25:18 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-08-09 Nat Duca <nduca@chromium.org>

Reviewed by Dimitri Glazkov.

[chromium] Blue line visible at the right hand side of the window with accelerated compositor
https://bugs.webkit.org/show_bug.cgi?id=43748

Correct the ortho projection matrix for the root layer, which was
too large by 0.5px in both width and height. For even view sizes,
this would cause the viewport to appear 1 pixel too small.

Fixing this requires removal of several 0.5 correction factors
that were previously added to compensate for the too-large viewport.

Finally, compute the translation for the root layer quad using
floating point rather than integer arithmetic. This avoids us losing
a key half-pixel of translation when the width of the window is odd.

To test, size window to even/odd dimensions. No blue line should be visible.

  • platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::drawLayers):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65019 r65020  
     12010-08-09  Nat Duca  <nduca@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        [chromium] Blue line visible at the right hand side of the window with accelerated compositor
     6        https://bugs.webkit.org/show_bug.cgi?id=43748
     7
     8        Correct the ortho projection matrix for the root layer, which was
     9        too large by 0.5px in both width and height. For even view sizes,
     10        this would cause the viewport to appear 1 pixel too small.
     11
     12        Fixing this requires removal of several 0.5 correction factors
     13        that were previously added to compensate for the too-large viewport.
     14
     15        Finally, compute the translation for the root layer quad using
     16        floating point rather than integer arithmetic. This avoids us losing
     17        a key half-pixel of translation when the width of the window is odd.
     18
     19        To test, size window to even/odd dimensions. No blue line should be visible.
     20
     21        * platform/graphics/chromium/LayerRendererChromium.cpp:
     22        (WebCore::LayerRendererChromium::drawLayers):
     23
    1242010-08-09  Ryosuke Niwa  <rniwa@webkit.org>
    225
  • trunk/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r64870 r65020  
    334334        m_rootLayerTextureHeight = visibleRect.height();
    335335
    336         m_projectionMatrix = orthoMatrix(0, visibleRectWidth + 0.5, visibleRectHeight + 0.5, 0, -1000, 1000);
     336        m_projectionMatrix = orthoMatrix(0, visibleRectWidth, visibleRectHeight, 0, -1000, 1000);
    337337        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_rootLayerTextureWidth, m_rootLayerTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
    338338
     
    392392#endif
    393393
    394         scrolledLayerMatrix.translate3d((int)floorf(0.5 * visibleRect.width() + 0.5) - scrollDelta.x(),
    395             (int)floorf(0.5 * visibleRect.height() + 0.5) + scaleFactor * scrollDelta.y(), 0);
     394        scrolledLayerMatrix.translate3d((int)floorf(0.5 * visibleRect.width()) - scrollDelta.x(),
     395            (int)floorf(0.5 * visibleRect.height()) + scaleFactor * scrollDelta.y(), 0);
    396396        scrolledLayerMatrix.scale3d(1, -1, 1);
    397397
     
    458458    checkGLError();
    459459    TransformationMatrix layerMatrix;
    460     layerMatrix.translate3d(visibleRect.width() / 2, visibleRect.height() / 2, 0);
     460    layerMatrix.translate3d(visibleRect.width() * 0.5f, visibleRect.height() * 0.5f, 0);
    461461    drawTexturedQuad(layerMatrix, visibleRect.width(), visibleRect.height(), 1);
    462462    checkGLError();
Note: See TracChangeset for help on using the changeset viewer.