Diff
Modified: trunk/Source/Platform/ChangeLog (124916 => 124917)
--- trunk/Source/Platform/ChangeLog 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/Platform/ChangeLog 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,3 +1,17 @@
+2012-08-07 James Robinson <[email protected]>
+
+ [chromium] Move WebCompositor interface into Platform API
+ https://bugs.webkit.org/show_bug.cgi?id=93391
+
+ Reviewed by Adam Barth.
+
+ WebCompositor is logically part of the Platform API, along with WebLayerTreeView and the WebLayer types.
+
+ * chromium/public/WebCompositor.h: Renamed from Source/WebKit/chromium/public/WebCompositorClient.h.
+ (WebKit):
+ (WebCompositor):
+ (WebKit::WebCompositor::~WebCompositor):
+
2012-08-06 James Robinson <[email protected]>
[chromium] Remove lingering unwrap<>() calls in GraphicsLayerChromium.cpp
Copied: trunk/Source/Platform/chromium/public/WebCompositor.h (from rev 124915, trunk/Source/WebKit/chromium/public/WebCompositorClient.h) (0 => 124917)
--- trunk/Source/Platform/chromium/public/WebCompositor.h (rev 0)
+++ trunk/Source/Platform/chromium/public/WebCompositor.h 2012-08-07 21:23:37 UTC (rev 124917)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebCompositor_h
+#define WebCompositor_h
+
+#define WEBCOMPOSITOR_OWNS_SETTINGS 1
+
+#include "WebCommon.h"
+
+namespace WebKit {
+
+class WebThread;
+
+// This class contains global routines for interacting with the
+// compositor.
+//
+// All calls to the WebCompositor must be made from the main thread.
+class WebCompositor {
+public:
+ // Initializes the compositor. Threaded compositing is enabled by passing in
+ // a non-null WebThread. No compositor classes or methods should be used
+ // prior to calling initialize.
+ WEBKIT_EXPORT static void initialize(WebThread*);
+
+ // Shuts down the compositor. This must be called when all compositor data
+ // types have been deleted. No compositor classes or methods should be used
+ // after shutdown.
+ WEBKIT_EXPORT static void shutdown();
+
+ // These may only be called before initialize.
+ WEBKIT_EXPORT static void setPerTilePaintingEnabled(bool);
+ WEBKIT_EXPORT static void setPartialSwapEnabled(bool);
+ WEBKIT_EXPORT static void setAcceleratedAnimationEnabled(bool);
+
+protected:
+ virtual ~WebCompositor() { }
+};
+
+} // namespace WebKit
+
+#endif
Property changes: trunk/Source/Platform/chromium/public/WebCompositor.h
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (124916 => 124917)
--- trunk/Source/WebCore/ChangeLog 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebCore/ChangeLog 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,3 +1,50 @@
+2012-08-07 James Robinson <[email protected]>
+
+ [chromium] Move WebCompositor interface into Platform API
+ https://bugs.webkit.org/show_bug.cgi?id=93391
+
+ Reviewed by Adam Barth.
+
+ Moves the support files for WebCompositor into WebCore/platform/support/. CCThreadImpl is a helper class used
+ only by WebCompositorImpl.
+
+ Refactor/renaming only, so no new tests.
+
+ * WebCore.gypi:
+ * platform/chromium/support/CCThreadImpl.cpp: Renamed from Source/WebKit/chromium/src/CCThreadImpl.cpp.
+ (WebKit):
+ (GetThreadIDTask):
+ (WebKit::GetThreadIDTask::GetThreadIDTask):
+ (WebKit::GetThreadIDTask::~GetThreadIDTask):
+ (WebKit::GetThreadIDTask::run):
+ (CCThreadTaskAdapter):
+ (WebKit::CCThreadTaskAdapter::CCThreadTaskAdapter):
+ (WebKit::CCThreadTaskAdapter::~CCThreadTaskAdapter):
+ (WebKit::CCThreadTaskAdapter::run):
+ (WebKit::CCThreadImpl::create):
+ (WebKit::CCThreadImpl::~CCThreadImpl):
+ (WebKit::CCThreadImpl::postTask):
+ (WebKit::CCThreadImpl::postDelayedTask):
+ (WebKit::CCThreadImpl::threadID):
+ (WebKit::CCThreadImpl::CCThreadImpl):
+ * platform/chromium/support/CCThreadImpl.h: Renamed from Source/WebKit/chromium/src/CCThreadImpl.h.
+ (WebKit):
+ (CCThreadImpl):
+ * platform/chromium/support/WebCompositorImpl.cpp: Renamed from Source/WebKit/chromium/src/WebCompositorImpl.cpp.
+ (WebKit):
+ (WebKit::WebCompositor::initialize):
+ (WebKit::WebCompositor::shutdown):
+ (WebKit::WebCompositor::setPerTilePaintingEnabled):
+ (WebKit::WebCompositor::setPartialSwapEnabled):
+ (WebKit::WebCompositor::setAcceleratedAnimationEnabled):
+ (WebKit::WebCompositorImpl::initialize):
+ (WebKit::WebCompositorImpl::initialized):
+ (WebKit::WebCompositorImpl::shutdown):
+ * platform/chromium/support/WebCompositorImpl.h: Renamed from Source/WebKit/chromium/src/WebCompositorImpl.h.
+ (WebCore):
+ (WebKit):
+ (WebCompositorImpl):
+
2012-08-07 Abhishek Arya <[email protected]>
Crash in ContainerNode::cloneChildNodes.
Modified: trunk/Source/WebCore/WebCore.gypi (124916 => 124917)
--- trunk/Source/WebCore/WebCore.gypi 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebCore/WebCore.gypi 2012-08-07 21:23:37 UTC (rev 124917)
@@ -8212,11 +8212,15 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/XPathGrammar.h',
],
'webcore_platform_support_files': [
+ 'platform/chromium/support/CCThreadImpl.cpp',
+ 'platform/chromium/support/CCThreadImpl.h',
'platform/chromium/support/Extensions3DChromium.cpp',
'platform/chromium/support/GraphicsContext3DChromium.cpp',
'platform/chromium/support/GraphicsContext3DPrivate.cpp',
'platform/chromium/support/GraphicsContext3DPrivate.h',
'platform/chromium/support/WebAudioBus.cpp',
+ 'platform/chromium/support/WebCompositorImpl.cpp',
+ 'platform/chromium/support/WebCompositorImpl.h',
'platform/chromium/support/WebData.cpp',
'platform/chromium/support/WebHTTPBody.cpp',
'platform/chromium/support/WebHTTPLoadInfo.cpp',
Copied: trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp (from rev 124915, trunk/Source/WebKit/chromium/src/CCThreadImpl.cpp) (0 => 124917)
--- trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp (rev 0)
+++ trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp 2012-08-07 21:23:37 UTC (rev 124917)
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CCThreadImpl.h"
+
+#include "cc/CCCompletionEvent.h"
+#include <public/Platform.h>
+#include <public/WebThread.h>
+
+using WebCore::CCThread;
+using WebCore::CCCompletionEvent;
+
+namespace WebKit {
+
+// Task that, when runs, places the current thread ID into the provided
+// pointer and signals a completion event.
+//
+// Does not provide a PassOwnPtr<GetThreadIDTask>::create method because
+// the resulting object is always handed into a WebThread, which does not understand
+// PassOwnPtrs.
+class GetThreadIDTask : public WebThread::Task {
+public:
+ GetThreadIDTask(ThreadIdentifier* result, CCCompletionEvent* completion)
+ : m_completion(completion)
+ , m_result(result) { }
+
+ virtual ~GetThreadIDTask() { }
+
+ virtual void run()
+ {
+ *m_result = currentThread();
+ m_completion->signal();
+ }
+
+private:
+ CCCompletionEvent* m_completion;
+ ThreadIdentifier* m_result;
+};
+
+// General adapter from a CCThread::Task to a WebThread::Task.
+class CCThreadTaskAdapter : public WebThread::Task {
+public:
+ CCThreadTaskAdapter(PassOwnPtr<CCThread::Task> task) : m_task(task) { }
+
+ virtual ~CCThreadTaskAdapter() { }
+
+ virtual void run()
+ {
+ m_task->performTask();
+ }
+
+private:
+ OwnPtr<CCThread::Task> m_task;
+};
+
+PassOwnPtr<CCThread> CCThreadImpl::create(WebThread* thread)
+{
+ return adoptPtr(new CCThreadImpl(thread));
+}
+
+CCThreadImpl::~CCThreadImpl()
+{
+}
+
+void CCThreadImpl::postTask(PassOwnPtr<CCThread::Task> task)
+{
+ m_thread->postTask(new CCThreadTaskAdapter(task));
+}
+
+void CCThreadImpl::postDelayedTask(PassOwnPtr<CCThread::Task> task, long long delayMs)
+{
+ m_thread->postDelayedTask(new CCThreadTaskAdapter(task), delayMs);
+}
+
+ThreadIdentifier CCThreadImpl::threadID() const
+{
+ return m_threadID;
+}
+
+CCThreadImpl::CCThreadImpl(WebThread* thread)
+ : m_thread(thread)
+{
+ if (thread == WebKit::Platform::current()->currentThread()) {
+ m_threadID = currentThread();
+ return;
+ }
+
+ // Get the threadId for the newly-created thread by running a task
+ // on that thread, blocking on the result.
+ m_threadID = currentThread();
+ CCCompletionEvent completion;
+ m_thread->postTask(new GetThreadIDTask(&m_threadID, &completion));
+ completion.wait();
+}
+
+} // namespace WebKit
Property changes: trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.cpp
Added: svn:eol-style
Copied: trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.h (from rev 124915, trunk/Source/WebKit/chromium/src/CCThreadImpl.h) (0 => 124917)
--- trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.h (rev 0)
+++ trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.h 2012-08-07 21:23:37 UTC (rev 124917)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "cc/CCThread.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/Threading.h>
+
+#ifndef CCThreadImpl_h
+#define CCThreadImpl_h
+
+namespace WebKit {
+
+class WebThread;
+
+// Implements CCThread in terms of WebThread.
+class CCThreadImpl : public WebCore::CCThread {
+public:
+ static PassOwnPtr<WebCore::CCThread> create(WebThread*);
+ virtual ~CCThreadImpl();
+ virtual void postTask(PassOwnPtr<WebCore::CCThread::Task>);
+ virtual void postDelayedTask(PassOwnPtr<WebCore::CCThread::Task>, long long delayMs);
+ WTF::ThreadIdentifier threadID() const;
+
+private:
+ explicit CCThreadImpl(WebThread*);
+
+ WebThread* m_thread;
+ WTF::ThreadIdentifier m_threadID;
+};
+
+} // namespace WebKit
+
+#endif
Property changes: trunk/Source/WebCore/platform/chromium/support/CCThreadImpl.h
Added: svn:eol-style
Copied: trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp (from rev 124915, trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp) (0 => 124917)
--- trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp (rev 0)
+++ trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp 2012-08-07 21:23:37 UTC (rev 124917)
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "WebCompositorImpl.h"
+
+#include "CCThreadImpl.h"
+#include "cc/CCLayerTreeHost.h"
+#include "cc/CCProxy.h"
+#include "cc/CCSettings.h"
+#include <public/Platform.h>
+#include <wtf/ThreadingPrimitives.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+bool WebCompositorImpl::s_initialized = false;
+CCThread* WebCompositorImpl::s_mainThread = 0;
+CCThread* WebCompositorImpl::s_implThread = 0;
+
+void WebCompositor::initialize(WebThread* implThread)
+{
+ WebCompositorImpl::initialize(implThread);
+}
+void WebCompositor::shutdown()
+{
+ WebCompositorImpl::shutdown();
+ CCSettings::reset();
+}
+
+void WebCompositor::setPerTilePaintingEnabled(bool enabled)
+{
+ ASSERT(!WebCompositorImpl::initialized());
+ CCSettings::setPerTilePaintingEnabled(enabled);
+}
+
+void WebCompositor::setPartialSwapEnabled(bool enabled)
+{
+ ASSERT(!WebCompositorImpl::initialized());
+ CCSettings::setPartialSwapEnabled(enabled);
+}
+
+void WebCompositor::setAcceleratedAnimationEnabled(bool enabled)
+{
+ ASSERT(!WebCompositorImpl::initialized());
+ CCSettings::setAcceleratedAnimationEnabled(enabled);
+}
+
+void WebCompositorImpl::initialize(WebThread* implThread)
+{
+ ASSERT(!s_initialized);
+ s_initialized = true;
+
+ s_mainThread = CCThreadImpl::create(WebKit::Platform::current()->currentThread()).leakPtr();
+ CCProxy::setMainThread(s_mainThread);
+ if (implThread) {
+ s_implThread = CCThreadImpl::create(implThread).leakPtr();
+ CCProxy::setImplThread(s_implThread);
+ } else
+ CCProxy::setImplThread(0);
+}
+
+bool WebCompositorImpl::initialized()
+{
+ return s_initialized;
+}
+
+void WebCompositorImpl::shutdown()
+{
+ ASSERT(s_initialized);
+ ASSERT(!CCLayerTreeHost::anyLayerTreeHostInstanceExists());
+
+ if (s_implThread) {
+ delete s_implThread;
+ s_implThread = 0;
+ }
+ delete s_mainThread;
+ s_mainThread = 0;
+ CCProxy::setImplThread(0);
+ CCProxy::setMainThread(0);
+ s_initialized = false;
+}
+
+}
Property changes: trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.cpp
Added: svn:eol-style
Copied: trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h (from rev 124915, trunk/Source/WebKit/chromium/src/WebCompositorImpl.h) (0 => 124917)
--- trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h (rev 0)
+++ trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h 2012-08-07 21:23:37 UTC (rev 124917)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebCompositorImpl_h
+#define WebCompositorImpl_h
+
+#include "WebCompositor.h"
+
+#include <wtf/HashSet.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+class CCThread;
+}
+
+namespace WebKit {
+
+class WebThread;
+
+class WebCompositorImpl : public WebCompositor {
+ WTF_MAKE_NONCOPYABLE(WebCompositorImpl);
+public:
+ static bool initialized();
+
+private:
+
+ friend class WebCompositor;
+ static void initialize(WebThread* implThread);
+ static void shutdown();
+
+ static bool s_initialized;
+ static WebCore::CCThread* s_mainThread;
+ static WebCore::CCThread* s_implThread;
+};
+
+}
+
+#endif // WebCompositorImpl_h
Property changes: trunk/Source/WebCore/platform/chromium/support/WebCompositorImpl.h
Added: svn:eol-style
Modified: trunk/Source/WebKit/chromium/ChangeLog (124916 => 124917)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,3 +1,14 @@
+2012-08-07 James Robinson <[email protected]>
+
+ [chromium] Move WebCompositor interface into Platform AP
+ https://bugs.webkit.org/show_bug.cgi?id=93391
+
+ Reviewed by Adam Barth.
+
+ * WebKit.gyp:
+ * public/WebCompositor.h:
+ * src/WebLayerTreeViewImpl.cpp:
+
2012-08-07 Joshua Bell <[email protected]>
REGRESSION(r124865): It broke the ARM Chromium build
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (124916 => 124917)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2012-08-07 21:23:37 UTC (rev 124917)
@@ -113,7 +113,6 @@
'public/WebCommonWorkerClient.h',
'public/WebCompositionUnderline.h',
'public/WebCompositor.h',
- 'public/WebCompositorClient.h',
'public/WebCompositorInputHandler.h',
'public/WebCompositorInputHandlerClient.h',
'public/WebConsoleMessage.h',
@@ -364,8 +363,6 @@
'src/BatteryClientImpl.h',
'src/BlobRegistryProxy.cpp',
'src/BlobRegistryProxy.h',
- 'src/CCThreadImpl.cpp',
- 'src/CCThreadImpl.h',
'src/ChromeClientImpl.cpp',
'src/ChromeClientImpl.h',
'src/ChromiumCurrentTime.cpp',
@@ -492,8 +489,6 @@
'src/WebCache.cpp',
'src/WebColorName.cpp',
'src/WebCommon.cpp',
- 'src/WebCompositorImpl.cpp',
- 'src/WebCompositorImpl.h',
'src/WebCompositorInputHandlerImpl.cpp',
'src/WebCompositorInputHandlerImpl.h',
'src/WebContentLayer.cpp',
Modified: trunk/Source/WebKit/chromium/public/WebCompositor.h (124916 => 124917)
--- trunk/Source/WebKit/chromium/public/WebCompositor.h 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/public/WebCompositor.h 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,43 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebCompositor_h
-#define WebCompositor_h
-
-#define WEBCOMPOSITOR_OWNS_SETTINGS 1
-
-#include "platform/WebCommon.h"
-
-namespace WebKit {
-
-class WebInputEvent;
-class WebThread;
-
-// This class contains global routines for interacting with the
-// compositor.
-//
-// All calls to the WebCompositor must be made from the main thread.
-class WebCompositor {
-public:
- // Initializes the compositor. Threaded compositing is enabled by passing in
- // a non-null WebThread. No compositor classes or methods should be used
- // prior to calling initialize.
- WEBKIT_EXPORT static void initialize(WebThread*);
-
- // Shuts down the compositor. This must be called when all compositor data
- // types have been deleted. No compositor classes or methods should be used
- // after shutdown.
- WEBKIT_EXPORT static void shutdown();
-
- // These may only be called before initialize.
- WEBKIT_EXPORT static void setPerTilePaintingEnabled(bool);
- WEBKIT_EXPORT static void setPartialSwapEnabled(bool);
- WEBKIT_EXPORT static void setAcceleratedAnimationEnabled(bool);
-
-protected:
- virtual ~WebCompositor() { }
-};
-
-} // namespace WebKit
-
-#endif
+// FIXME: This is a temporary forwarding header, remove once chromium-side code
+// stops using this include path.
+#include "../../../Platform/chromium/public/WebCompositor.h"
Deleted: trunk/Source/WebKit/chromium/public/WebCompositorClient.h (124916 => 124917)
--- trunk/Source/WebKit/chromium/public/WebCompositorClient.h 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/public/WebCompositorClient.h 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebCompositorClient_h
-#define WebCompositorClient_h
-
-#include "WebCompositorInputHandlerClient.h"
-
-namespace WebKit {
-
-// This class will go away once downstream code has transitioned
-// to WebCompositorInputHandlerClient.
-class WebCompositorClient : public WebCompositorInputHandlerClient {
-public:
-protected:
- virtual ~WebCompositorClient() { }
-};
-
-} // namespace WebKit
-
-#endif
Deleted: trunk/Source/WebKit/chromium/src/CCThreadImpl.cpp (124916 => 124917)
--- trunk/Source/WebKit/chromium/src/CCThreadImpl.cpp 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/src/CCThreadImpl.cpp 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CCThreadImpl.h"
-
-#include "WebKit.h"
-#include "platform/WebKitPlatformSupport.h"
-#include "platform/WebThread.h"
-#include "cc/CCCompletionEvent.h"
-#include <stdint.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-// Task that, when runs, places the current thread ID into the provided
-// pointer and signals a completion event.
-//
-// Does not provide a PassOwnPtr<GetThreadIDTask>::create method because
-// the resulting object is always handed into a WebThread, which does not understand
-// PassOwnPtrs.
-class GetThreadIDTask : public WebThread::Task {
-public:
- GetThreadIDTask(ThreadIdentifier* result, CCCompletionEvent* completion)
- : m_completion(completion)
- , m_result(result) { }
-
- virtual ~GetThreadIDTask() { }
-
- virtual void run()
- {
- *m_result = currentThread();
- m_completion->signal();
- }
-
-private:
- CCCompletionEvent* m_completion;
- ThreadIdentifier* m_result;
-};
-
-// General adapter from a CCThread::Task to a WebThread::Task.
-class CCThreadTaskAdapter : public WebThread::Task {
-public:
- CCThreadTaskAdapter(PassOwnPtr<CCThread::Task> task) : m_task(task) { }
-
- virtual ~CCThreadTaskAdapter() { }
-
- virtual void run()
- {
- m_task->performTask();
- }
-
-private:
- OwnPtr<CCThread::Task> m_task;
-};
-
-PassOwnPtr<CCThread> CCThreadImpl::create(WebThread* thread)
-{
- return adoptPtr(new CCThreadImpl(thread));
-}
-
-CCThreadImpl::~CCThreadImpl()
-{
-}
-
-void CCThreadImpl::postTask(PassOwnPtr<CCThread::Task> task)
-{
- m_thread->postTask(new CCThreadTaskAdapter(task));
-}
-
-void CCThreadImpl::postDelayedTask(PassOwnPtr<CCThread::Task> task, long long delayMs)
-{
- m_thread->postDelayedTask(new CCThreadTaskAdapter(task), delayMs);
-}
-
-ThreadIdentifier CCThreadImpl::threadID() const
-{
- return m_threadID;
-}
-
-CCThreadImpl::CCThreadImpl(WebThread* thread)
- : m_thread(thread)
-{
- if (thread == WebKit::Platform::current()->currentThread()) {
- m_threadID = currentThread();
- return;
- }
-
- // Get the threadId for the newly-created thread by running a task
- // on that thread, blocking on the result.
- m_threadID = currentThread();
- CCCompletionEvent completion;
- m_thread->postTask(new GetThreadIDTask(&m_threadID, &completion));
- completion.wait();
-}
-
-} // namespace WebKit
Deleted: trunk/Source/WebKit/chromium/src/CCThreadImpl.h (124916 => 124917)
--- trunk/Source/WebKit/chromium/src/CCThreadImpl.h 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/src/CCThreadImpl.h 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "cc/CCThread.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/Threading.h>
-
-
-#ifndef CCThreadImpl_h
-#define CCThreadImpl_h
-
-namespace WebKit {
-
-class WebThread;
-
-// Implements CCThread in terms of WebThread.
-class CCThreadImpl : public WebCore::CCThread {
-public:
- static PassOwnPtr<WebCore::CCThread> create(WebThread*);
- virtual ~CCThreadImpl();
- virtual void postTask(PassOwnPtr<WebCore::CCThread::Task>);
- virtual void postDelayedTask(PassOwnPtr<WebCore::CCThread::Task>, long long delayMs);
- WTF::ThreadIdentifier threadID() const;
-
-private:
- explicit CCThreadImpl(WebThread*);
-
- WebThread* m_thread;
- WTF::ThreadIdentifier m_threadID;
-};
-
-} // namespace WebKit
-
-#endif
Deleted: trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp (124916 => 124917)
--- trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/src/WebCompositorImpl.cpp 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "WebCompositorImpl.h"
-
-#include "CCThreadImpl.h"
-#include "GraphicsContext3D.h"
-#include "WebKit.h"
-#include "platform/WebKitPlatformSupport.h"
-#include "WebCompositorClient.h"
-#include "WebInputEvent.h"
-#include "cc/CCLayerTreeHost.h"
-#include "cc/CCProxy.h"
-#include "cc/CCSettings.h"
-#include <wtf/ThreadingPrimitives.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-bool WebCompositorImpl::s_initialized = false;
-CCThread* WebCompositorImpl::s_mainThread = 0;
-CCThread* WebCompositorImpl::s_implThread = 0;
-
-void WebCompositor::initialize(WebThread* implThread)
-{
- WebCompositorImpl::initialize(implThread);
-}
-void WebCompositor::shutdown()
-{
- WebCompositorImpl::shutdown();
- CCSettings::reset();
-}
-
-void WebCompositor::setPerTilePaintingEnabled(bool enabled)
-{
- ASSERT(!WebCompositorImpl::initialized());
- CCSettings::setPerTilePaintingEnabled(enabled);
-}
-
-void WebCompositor::setPartialSwapEnabled(bool enabled)
-{
- ASSERT(!WebCompositorImpl::initialized());
- CCSettings::setPartialSwapEnabled(enabled);
-}
-
-void WebCompositor::setAcceleratedAnimationEnabled(bool enabled)
-{
- ASSERT(!WebCompositorImpl::initialized());
- CCSettings::setAcceleratedAnimationEnabled(enabled);
-}
-
-void WebCompositorImpl::initialize(WebThread* implThread)
-{
- ASSERT(!s_initialized);
- s_initialized = true;
-
- s_mainThread = CCThreadImpl::create(WebKit::Platform::current()->currentThread()).leakPtr();
- CCProxy::setMainThread(s_mainThread);
- if (implThread) {
- s_implThread = CCThreadImpl::create(implThread).leakPtr();
- CCProxy::setImplThread(s_implThread);
- } else
- CCProxy::setImplThread(0);
-}
-
-bool WebCompositorImpl::initialized()
-{
- return s_initialized;
-}
-
-void WebCompositorImpl::shutdown()
-{
- ASSERT(s_initialized);
- ASSERT(!CCLayerTreeHost::anyLayerTreeHostInstanceExists());
-
- if (s_implThread) {
- delete s_implThread;
- s_implThread = 0;
- }
- delete s_mainThread;
- s_mainThread = 0;
- CCProxy::setImplThread(0);
- CCProxy::setMainThread(0);
- s_initialized = false;
-}
-
-}
Deleted: trunk/Source/WebKit/chromium/src/WebCompositorImpl.h (124916 => 124917)
--- trunk/Source/WebKit/chromium/src/WebCompositorImpl.h 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/src/WebCompositorImpl.h 2012-08-07 21:23:37 UTC (rev 124917)
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebCompositorImpl_h
-#define WebCompositorImpl_h
-
-#include "WebCompositor.h"
-
-#include <wtf/HashSet.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/OwnPtr.h>
-
-namespace WebCore {
-class CCThread;
-}
-
-namespace WebKit {
-
-class WebThread;
-
-class WebCompositorImpl : public WebCompositor {
- WTF_MAKE_NONCOPYABLE(WebCompositorImpl);
-public:
- static bool initialized();
-
-private:
-
- friend class WebCompositor;
- static void initialize(WebThread* implThread);
- static void shutdown();
-
- static bool s_initialized;
- static WebCore::CCThread* s_mainThread;
- static WebCore::CCThread* s_implThread;
-};
-
-}
-
-#endif // WebCompositorImpl_h
Modified: trunk/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp (124916 => 124917)
--- trunk/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp 2012-08-07 21:14:00 UTC (rev 124916)
+++ trunk/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp 2012-08-07 21:23:37 UTC (rev 124917)
@@ -26,7 +26,6 @@
#include "config.h"
#include "WebLayerTreeViewImpl.h"
-#include "CCThreadImpl.h"
#include "GraphicsContext3DPrivate.h"
#include "LayerChromium.h"
#include "cc/CCLayerTreeHost.h"