Changeset 97232 in webkit


Ignore:
Timestamp:
Oct 11, 2011 10:35:44 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Separate compositor client thread from webkit's main thread.
https://bugs.webkit.org/show_bug.cgi?id=69048

Patch by Antoine Labour <piman@chromium.org> on 2011-10-11
Reviewed by Darin Fisher.

Source/WebCore:

Covered by compositing tests.

  • platform/graphics/chromium/cc/CCLayerTreeHost.cpp:

(WebCore::CCLayerTreeHost::CCLayerTreeHost):

  • platform/graphics/chromium/cc/CCMainThread.cpp:
  • platform/graphics/chromium/cc/CCMainThread.h:
  • platform/graphics/chromium/cc/CCProxy.cpp:

(WebCore::CCProxy::isMainThread):
(WebCore::CCProxy::setMainThread):
(WebCore::CCProxy::CCProxy):

  • platform/graphics/chromium/cc/CCProxy.h:

Source/WebKit/chromium:

  • WebKit.gyp:
  • public/WebKitPlatformSupport.h:

(WebKit::WebKitPlatformSupport::currentThread):

  • src/CCMainThreadImpl.cpp: Added.

(WTF::TaskWrapper::TaskWrapper):
(WTF::TaskWrapper::~TaskWrapper):
(WTF::TaskWrapper::run):
(WebCore::CCMainThread::initialize):
(WebCore::CCMainThread::postTask):

Location:
trunk/Source
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r97229 r97232  
     12011-10-11  Antoine Labour  <piman@chromium.org>
     2
     3        Separate compositor client thread from webkit's main thread.
     4        https://bugs.webkit.org/show_bug.cgi?id=69048
     5
     6        Reviewed by Darin Fisher.
     7
     8        Covered by compositing tests.
     9
     10        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     11        (WebCore::CCLayerTreeHost::CCLayerTreeHost):
     12        * platform/graphics/chromium/cc/CCMainThread.cpp:
     13        * platform/graphics/chromium/cc/CCMainThread.h:
     14        * platform/graphics/chromium/cc/CCProxy.cpp:
     15        (WebCore::CCProxy::isMainThread):
     16        (WebCore::CCProxy::setMainThread):
     17        (WebCore::CCProxy::CCProxy):
     18        * platform/graphics/chromium/cc/CCProxy.h:
     19
    1202011-10-11  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r96766 r97232  
    3434#include "cc/CCLayerTreeHostCommon.h"
    3535#include "cc/CCLayerTreeHostImpl.h"
     36#include "cc/CCMainThread.h"
    3637#include "cc/CCSingleThreadProxy.h"
    3738#include "cc/CCThread.h"
     
    5758    , m_visible(true)
    5859{
     60    CCMainThread::initialize();
    5961    ASSERT(CCProxy::isMainThread());
    6062}
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.cpp

    r95901 r97232  
    3939}
    4040
    41 void CCMainThread::postTask(PassOwnPtr<Task> task)
    42 {
    43     callOnMainThread(performTask, task.leakPtr());
    4441}
    45 
    46 }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThread.h

    r95901 r97232  
    4444    };
    4545
     46    static void initialize();
    4647    static void postTask(PassOwnPtr<Task>); // Executes the task on main thread asynchronously.
    4748private:
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.cpp

    r96066 r97232  
    4242bool fakeImplThread = false;
    4343static WTF::ThreadIdentifier implThreadID;
     44static WTF::ThreadIdentifier mainThreadID;
    4445}
    4546
    4647bool CCProxy::isMainThread()
    4748{
    48     return ::isMainThread() && !fakeImplThread;
     49    return !fakeImplThread && currentThread() == mainThreadID;
    4950}
    5051
     
    6465}
    6566
     67void CCProxy::setMainThread(WTF::ThreadIdentifier id)
     68{
     69    mainThreadID = id;
     70}
     71
    6672#endif // !NDEBUG
    6773
     74CCProxy::CCProxy()
     75{
     76    ASSERT(isMainThread());
    6877}
     78
     79}
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h

    r96736 r97232  
    8787    static void setImplThread(bool);
    8888    static void setImplThread(WTF::ThreadIdentifier);
     89    static void setMainThread(WTF::ThreadIdentifier);
    8990#endif
    9091
    9192protected:
    92     CCProxy() { }
     93    CCProxy();
    9394    friend class DebugScopedSetImplThread;
    9495};
  • trunk/Source/WebKit/chromium/ChangeLog

    r97227 r97232  
     12011-10-11  Antoine Labour  <piman@chromium.org>
     2
     3        Separate compositor client thread from webkit's main thread.
     4        https://bugs.webkit.org/show_bug.cgi?id=69048
     5
     6        Reviewed by Darin Fisher.
     7
     8        * WebKit.gyp:
     9        * public/WebKitPlatformSupport.h:
     10        (WebKit::WebKitPlatformSupport::currentThread):
     11        * src/CCMainThreadImpl.cpp: Added.
     12        (WTF::TaskWrapper::TaskWrapper):
     13        (WTF::TaskWrapper::~TaskWrapper):
     14        (WTF::TaskWrapper::run):
     15        (WebCore::CCMainThread::initialize):
     16        (WebCore::CCMainThread::postTask):
     17
    1182011-10-11  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r97068 r97232  
    339339                'src/BoundObject.cpp',
    340340                'src/BoundObject.h',
     341                'src/CCMainThreadImpl.cpp',
    341342                'src/CCThreadImpl.cpp',
    342343                'src/CCThreadImpl.h',
  • trunk/Source/WebKit/chromium/public/WebKitPlatformSupport.h

    r95901 r97232  
    187187    virtual WebThread* createThread(const char* name) { return 0; }
    188188
     189    // Returns an interface to the current thread. This is owned by the
     190    // embedder.
     191    virtual WebThread* currentThread() { return 0; }
     192
    189193
    190194    // Message Ports -------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.