Changeset 201859 in webkit


Ignore:
Timestamp:
Jun 9, 2016 5:07:38 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

[Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
https://bugs.webkit.org/show_bug.cgi?id=158523

Reviewed by Michael Catanzaro.

ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
schedule a task to the update the timer in the compositing thread, we can do that directly in the main
thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().

  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:

(WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
(WebKit::ThreadedCompositor::updateSceneState):

  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r201857 r201859  
     12016-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
     4        https://bugs.webkit.org/show_bug.cgi?id=158523
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
     9        compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
     10        schedule a task to the update the timer in the compositing thread, we can do that directly in the main
     11        thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().
     12
     13        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
     14        (WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
     15        (WebKit::ThreadedCompositor::updateSceneState):
     16        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
     17
    1182016-06-08  Antti Koivisto  <antti@apple.com>
    219
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp

    r199048 r201859  
    6262}
    6363
    64 void ThreadedCompositor::setNeedsDisplay()
    65 {
    66     RefPtr<ThreadedCompositor> protector(this);
    67     callOnCompositingThread([protector] {
    68         protector->scheduleDisplayImmediately();
    69     });
    70 }
    71 
    7264void ThreadedCompositor::setNativeSurfaceHandleForCompositing(uint64_t handle)
    7365{
     
    222214    });
    223215
    224     setNeedsDisplay();
     216    scheduleDisplayImmediately();
    225217}
    226218
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h

    r199048 r201859  
    6565    virtual ~ThreadedCompositor();
    6666
    67     void setNeedsDisplay();
    68 
    6967    void setNativeSurfaceHandleForCompositing(uint64_t);
    7068    void setDeviceScaleFactor(float);
Note: See TracChangeset for help on using the changeset viewer.