Changeset 269842 in webkit


Ignore:
Timestamp:
Nov 16, 2020 2:06:59 AM (3 years ago)
Author:
zandobersek@gmail.com
Message:

[CoordinatedGraphics] Adjust client resizing, render-scope notifying in ThreadedCompositor::renderLayerTree()
https://bugs.webkit.org/show_bug.cgi?id=218701

Reviewed by Carlos Garcia Campos.

Rework the client operations in ThreadedCompositor::renderLayerTree() so
that client resizing is done before the will-render client notification
is dispatched. This ensures everything in the will-render-to-did-render
scope is done for a well-specified size from the client's point of view.

Similar to this change, the GL viewport update is split from the client
resize operation and moved into the aforementioned rendering scope. This
change is mostly cosmetic, but it's done to neatly package all the GL
operations into that scope.

  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:

(WebKit::ThreadedCompositor::renderLayerTree):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r269824 r269842  
     12020-11-16  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [CoordinatedGraphics] Adjust client resizing, render-scope notifying in ThreadedCompositor::renderLayerTree()
     4        https://bugs.webkit.org/show_bug.cgi?id=218701
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Rework the client operations in ThreadedCompositor::renderLayerTree() so
     9        that client resizing is done before the will-render client notification
     10        is dispatched. This ensures everything in the will-render-to-did-render
     11        scope is done for a well-specified size from the client's point of view.
     12
     13        Similar to this change, the GL viewport update is split from the client
     14        resize operation and moved into the aforementioned rendering scope. This
     15        change is mostly cosmetic, but it's done to neatly package all the GL
     16        operations into that scope.
     17
     18        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
     19        (WebKit::ThreadedCompositor::renderLayerTree):
     20
    1212020-11-15  Tim Horton  <timothy_horton@apple.com>
    222
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp

    r261333 r269842  
    177177        return;
    178178
    179     m_client.willRenderFrame();
    180 
    181179    // Retrieve the scene attributes in a thread-safe manner.
    182180    WebCore::IntSize viewportSize;
     
    205203    }
    206204
    207     if (needsResize) {
    208         m_client.resize(viewportSize);
    209         glViewport(0, 0, viewportSize.width(), viewportSize.height());
    210     }
    211 
    212205    TransformationMatrix viewportTransform;
    213206    viewportTransform.scale(scaleFactor);
    214207    viewportTransform.translate(-scrollPosition.x(), -scrollPosition.y());
     208
     209    // Resize the client, if necessary, before the will-render-frame call is dispatched.
     210    // GL viewport is updated separately, if necessary. This establishes sequencing where
     211    // everything inside the will-render and did-render scope is done for a constant-sized scene,
     212    // and similarly all GL operations are done inside that specific scope.
     213
     214    if (needsResize)
     215        m_client.resize(viewportSize);
     216
     217    m_client.willRenderFrame();
     218
     219    if (needsResize)
     220        glViewport(0, 0, viewportSize.width(), viewportSize.height());
    215221
    216222    glClearColor(0, 0, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.