| OLD | NEW |
| 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 using namespace WebCore; | 16 using namespace WebCore; |
| 17 | 17 |
| 18 namespace WebKit { | 18 namespace WebKit { |
| 19 | 19 |
| 20 bool WebCompositorImpl::s_initialized = false; | 20 bool WebCompositorImpl::s_initialized = false; |
| 21 CCThread* WebCompositorImpl::s_mainThread = 0; | 21 CCThread* WebCompositorImpl::s_mainThread = 0; |
| 22 CCThread* WebCompositorImpl::s_implThread = 0; | 22 CCThread* WebCompositorImpl::s_implThread = 0; |
| 23 | 23 |
| 24 void WebCompositor::initialize(WebThread* implThread) | 24 void WebCompositor::initialize(WebThread* implThread) |
| 25 { | 25 { |
| 26 WebCompositorImpl::initialize(implThread); | 26 WebCompositorImpl::initialize(implThread); |
| 27 } | 27 } |
| 28 | 28 |
| 29 bool WebCompositor::threadingEnabled() | 29 bool WebCompositor::isThreadingEnabled() |
| 30 { | 30 { |
| 31 return WebCompositorImpl::threadingEnabled(); | 31 return WebCompositorImpl::isThreadingEnabled(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void WebCompositor::shutdown() | 34 void WebCompositor::shutdown() |
| 35 { | 35 { |
| 36 WebCompositorImpl::shutdown(); | 36 WebCompositorImpl::shutdown(); |
| 37 CCSettings::reset(); | 37 CCSettings::reset(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void WebCompositor::setPerTilePaintingEnabled(bool enabled) | 40 void WebCompositor::setPerTilePaintingEnabled(bool enabled) |
| 41 { | 41 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 62 | 62 |
| 63 s_mainThread = CCThreadImpl::create(WebKit::Platform::current()->currentThre
ad()).leakPtr(); | 63 s_mainThread = CCThreadImpl::create(WebKit::Platform::current()->currentThre
ad()).leakPtr(); |
| 64 CCProxy::setMainThread(s_mainThread); | 64 CCProxy::setMainThread(s_mainThread); |
| 65 if (implThread) { | 65 if (implThread) { |
| 66 s_implThread = CCThreadImpl::create(implThread).leakPtr(); | 66 s_implThread = CCThreadImpl::create(implThread).leakPtr(); |
| 67 CCProxy::setImplThread(s_implThread); | 67 CCProxy::setImplThread(s_implThread); |
| 68 } else | 68 } else |
| 69 CCProxy::setImplThread(0); | 69 CCProxy::setImplThread(0); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool WebCompositorImpl::threadingEnabled() | 72 bool WebCompositorImpl::isThreadingEnabled() |
| 73 { | 73 { |
| 74 return s_implThread; | 74 return s_implThread; |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool WebCompositorImpl::initialized() | 77 bool WebCompositorImpl::initialized() |
| 78 { | 78 { |
| 79 return s_initialized; | 79 return s_initialized; |
| 80 } | 80 } |
| 81 | 81 |
| 82 void WebCompositorImpl::shutdown() | 82 void WebCompositorImpl::shutdown() |
| 83 { | 83 { |
| 84 ASSERT(s_initialized); | 84 ASSERT(s_initialized); |
| 85 ASSERT(!CCLayerTreeHost::anyLayerTreeHostInstanceExists()); | 85 ASSERT(!CCLayerTreeHost::anyLayerTreeHostInstanceExists()); |
| 86 | 86 |
| 87 if (s_implThread) { | 87 if (s_implThread) { |
| 88 delete s_implThread; | 88 delete s_implThread; |
| 89 s_implThread = 0; | 89 s_implThread = 0; |
| 90 } | 90 } |
| 91 delete s_mainThread; | 91 delete s_mainThread; |
| 92 s_mainThread = 0; | 92 s_mainThread = 0; |
| 93 CCProxy::setImplThread(0); | 93 CCProxy::setImplThread(0); |
| 94 CCProxy::setMainThread(0); | 94 CCProxy::setMainThread(0); |
| 95 s_initialized = false; | 95 s_initialized = false; |
| 96 } | 96 } |
| 97 | 97 |
| 98 } | 98 } |
| OLD | NEW |