Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: webkit/compositor_bindings/WebCompositorImpl.cpp

Issue 10913158: Avoid using WTF threading code in cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/compositor_bindings/CCThreadImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "WebCompositorImpl.h" 7 #include "WebCompositorImpl.h"
8 8
9 #include "CCLayerTreeHost.h" 9 #include "CCLayerTreeHost.h"
10 #include "CCProxy.h" 10 #include "CCProxy.h"
11 #include "CCSettings.h" 11 #include "CCSettings.h"
12 #include "CCThreadImpl.h" 12 #include "CCThreadImpl.h"
13 #include <public/Platform.h> 13 #include <public/Platform.h>
14 #include <wtf/ThreadingPrimitives.h> 14 #include <wtf/ThreadingPrimitives.h>
15 15
16 #if defined(USE_LIBCC_FOR_COMPOSITOR)
17 #ifdef LOG
18 #undef LOG
19 #endif
20 #include "base/message_loop_proxy.h"
21 #include "webkit/glue/webthread_impl.h"
22 #endif
23
16 using namespace WebCore; 24 using namespace WebCore;
17 25
18 namespace WebKit { 26 namespace WebKit {
19 27
20 bool WebCompositorImpl::s_initialized = false; 28 bool WebCompositorImpl::s_initialized = false;
21 CCThread* WebCompositorImpl::s_mainThread = 0; 29 CCThread* WebCompositorImpl::s_mainThread = 0;
22 CCThread* WebCompositorImpl::s_implThread = 0; 30 CCThread* WebCompositorImpl::s_implThread = 0;
23 31
24 void WebCompositor::initialize(WebThread* implThread) 32 void WebCompositor::initialize(WebThread* implThread)
25 { 33 {
(...skipping 27 matching lines...) Expand all
53 { 61 {
54 ASSERT(!WebCompositorImpl::initialized()); 62 ASSERT(!WebCompositorImpl::initialized());
55 CCSettings::setAcceleratedAnimationEnabled(enabled); 63 CCSettings::setAcceleratedAnimationEnabled(enabled);
56 } 64 }
57 65
58 void WebCompositorImpl::initialize(WebThread* implThread) 66 void WebCompositorImpl::initialize(WebThread* implThread)
59 { 67 {
60 ASSERT(!s_initialized); 68 ASSERT(!s_initialized);
61 s_initialized = true; 69 s_initialized = true;
62 70
63 s_mainThread = CCThreadImpl::create(WebKit::Platform::current()->currentThre ad()).leakPtr(); 71 s_mainThread = CCThreadImpl::createForCurrentThread().leakPtr();
64 CCProxy::setMainThread(s_mainThread); 72 CCProxy::setMainThread(s_mainThread);
65 if (implThread) { 73 if (implThread) {
66 s_implThread = CCThreadImpl::create(implThread).leakPtr(); 74 s_implThread = CCThreadImpl::createForDifferentThread(implThread).leakPt r();
67 CCProxy::setImplThread(s_implThread); 75 CCProxy::setImplThread(s_implThread);
68 } else 76 } else
69 CCProxy::setImplThread(0); 77 CCProxy::setImplThread(0);
70 } 78 }
71 79
72 bool WebCompositorImpl::isThreadingEnabled() 80 bool WebCompositorImpl::isThreadingEnabled()
73 { 81 {
74 return s_implThread; 82 return s_implThread;
75 } 83 }
76 84
(...skipping 12 matching lines...) Expand all
89 s_implThread = 0; 97 s_implThread = 0;
90 } 98 }
91 delete s_mainThread; 99 delete s_mainThread;
92 s_mainThread = 0; 100 s_mainThread = 0;
93 CCProxy::setImplThread(0); 101 CCProxy::setImplThread(0);
94 CCProxy::setMainThread(0); 102 CCProxy::setMainThread(0);
95 s_initialized = false; 103 s_initialized = false;
96 } 104 }
97 105
98 } 106 }
OLDNEW
« no previous file with comments | « webkit/compositor_bindings/CCThreadImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698