[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
aroben at apple.com
aroben at apple.com
Mon Feb 21 00:05:04 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 22daa061acd8e80e62bf85eeba19ae39746d9428
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 27 23:40:41 2011 +0000
Add WKCACFViewLayerTreeHost
This is a class that derives from CACFLayerTreeHost and uses a WKCACFView to render.
Fixes <http://webkit.org/b/53251> <rdar://problem/8925496> CACFLayerTreeHost should use
WKCACFView for rendering
* WebCore.vcproj/WebCore.vcproj: Added WKCACFViewLayerTreeHost.{cpp,h}.
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable): Make the test window have a
non-zero size. WKCACFView will always say it can't render if you pass it a 0-sized window,
so we need a non-empty window to perform a valid test.
(WebCore::CACFLayerTreeHost::create): First try to create a WKCACFViewLayerTreeHost, then
fall back to a LegacyCACFLayerTreeHost.
(WebCore::CACFLayerTreeHost::flushPendingLayerChangesNow): Moved code to react to the
context flush from here...
(WebCore::CACFLayerTreeHost::contextDidChange): ...to here. Derived classes are required to
call this function whenever changes are flushed to the context.
* platform/graphics/ca/win/CACFLayerTreeHost.h: Added contextDidChange.
* platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp:
(WebCore::LegacyCACFLayerTreeHost::createRenderer):
(WebCore::LegacyCACFLayerTreeHost::resize):
Changed to use flushContext instead of flushing the context manually so that we will always
notify the base class when the context gets flushed.
(WebCore::LegacyCACFLayerTreeHost::flushContext): Added a call to contextDidChange so the
base class will know what happened. Moved code to schedule a render from here...
(WebCore::LegacyCACFLayerTreeHost::contextDidChange): ...to here.
* platform/graphics/ca/win/LegacyCACFLayerTreeHost.h: Added contextDidChange.
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: Added.
(WebCore::WKCACFViewLayerTreeHost::create): If WebKitQuartzCoreAdditions, which provides
WKCACFView, isn't present, bail. Otherwise allocate and return a new host.
(WebCore::WKCACFViewLayerTreeHost::WKCACFViewLayerTreeHost): Initialize members.
(WebCore::WKCACFViewLayerTreeHost::updateViewIfNeeded): Update the view if we previously
marked that we needed to do so, and flush the context if our layer's bounds have changed.
(WebCore::WKCACFViewLayerTreeHost::contextDidChangeCallback): Call through to
contextDidChange.
(WebCore::WKCACFViewLayerTreeHost::contextDidChange): Tell the WKCACFView to start rendering
(if we didn't already), then call up to the base class.
(WebCore::WKCACFViewLayerTreeHost::initializeContext): Set the context's user data, the
view's layer, and hook up our "context did change" callback.
(WebCore::WKCACFViewLayerTreeHost::resize): Mark that the view needs to be updated the next
time we paint.
(WebCore::WKCACFViewLayerTreeHost::createRenderer): Update our view and return whether it is
able to render or not.
(WebCore::WKCACFViewLayerTreeHost::destroyRenderer): Clear out all the info we passed down
to the view.
(WebCore::WKCACFViewLayerTreeHost::lastCommitTime): Call through to the view.
(WebCore::WKCACFViewLayerTreeHost::flushContext): Ditto.
(WebCore::WKCACFViewLayerTreeHost::paint): Update the view so it will draw at the right
size, then call up to the base class.
(WebCore::WKCACFViewLayerTreeHost::render): Invalidate the view using the passed-in dirty
rects, then ask it to draw.
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.h: Copied from Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 6ee5ef5..c7c7f86 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,5 +1,68 @@
2011-01-27 Adam Roben <aroben at apple.com>
+ Add WKCACFViewLayerTreeHost
+
+ This is a class that derives from CACFLayerTreeHost and uses a WKCACFView to render.
+
+ Fixes <http://webkit.org/b/53251> <rdar://problem/8925496> CACFLayerTreeHost should use
+ WKCACFView for rendering
+
+ * WebCore.vcproj/WebCore.vcproj: Added WKCACFViewLayerTreeHost.{cpp,h}.
+
+ * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+ (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable): Make the test window have a
+ non-zero size. WKCACFView will always say it can't render if you pass it a 0-sized window,
+ so we need a non-empty window to perform a valid test.
+ (WebCore::CACFLayerTreeHost::create): First try to create a WKCACFViewLayerTreeHost, then
+ fall back to a LegacyCACFLayerTreeHost.
+ (WebCore::CACFLayerTreeHost::flushPendingLayerChangesNow): Moved code to react to the
+ context flush from here...
+ (WebCore::CACFLayerTreeHost::contextDidChange): ...to here. Derived classes are required to
+ call this function whenever changes are flushed to the context.
+
+ * platform/graphics/ca/win/CACFLayerTreeHost.h: Added contextDidChange.
+
+ * platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp:
+ (WebCore::LegacyCACFLayerTreeHost::createRenderer):
+ (WebCore::LegacyCACFLayerTreeHost::resize):
+ Changed to use flushContext instead of flushing the context manually so that we will always
+ notify the base class when the context gets flushed.
+
+ (WebCore::LegacyCACFLayerTreeHost::flushContext): Added a call to contextDidChange so the
+ base class will know what happened. Moved code to schedule a render from here...
+ (WebCore::LegacyCACFLayerTreeHost::contextDidChange): ...to here.
+
+ * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h: Added contextDidChange.
+
+ * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp: Added.
+ (WebCore::WKCACFViewLayerTreeHost::create): If WebKitQuartzCoreAdditions, which provides
+ WKCACFView, isn't present, bail. Otherwise allocate and return a new host.
+ (WebCore::WKCACFViewLayerTreeHost::WKCACFViewLayerTreeHost): Initialize members.
+ (WebCore::WKCACFViewLayerTreeHost::updateViewIfNeeded): Update the view if we previously
+ marked that we needed to do so, and flush the context if our layer's bounds have changed.
+ (WebCore::WKCACFViewLayerTreeHost::contextDidChangeCallback): Call through to
+ contextDidChange.
+ (WebCore::WKCACFViewLayerTreeHost::contextDidChange): Tell the WKCACFView to start rendering
+ (if we didn't already), then call up to the base class.
+ (WebCore::WKCACFViewLayerTreeHost::initializeContext): Set the context's user data, the
+ view's layer, and hook up our "context did change" callback.
+ (WebCore::WKCACFViewLayerTreeHost::resize): Mark that the view needs to be updated the next
+ time we paint.
+ (WebCore::WKCACFViewLayerTreeHost::createRenderer): Update our view and return whether it is
+ able to render or not.
+ (WebCore::WKCACFViewLayerTreeHost::destroyRenderer): Clear out all the info we passed down
+ to the view.
+ (WebCore::WKCACFViewLayerTreeHost::lastCommitTime): Call through to the view.
+ (WebCore::WKCACFViewLayerTreeHost::flushContext): Ditto.
+ (WebCore::WKCACFViewLayerTreeHost::paint): Update the view so it will draw at the right
+ size, then call up to the base class.
+ (WebCore::WKCACFViewLayerTreeHost::render): Invalidate the view using the passed-in dirty
+ rects, then ask it to draw.
+
+ * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h: Copied from Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h.
+
+2011-01-27 Adam Roben <aroben at apple.com>
+
Move LegacyCACFLayerTreeHost into its own files
More preparation for <http://webkit.org/b/53251> <rdar://problem/8925496> CACFLayerTreeHost
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index 355b8ba..75dbe88 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -28966,6 +28966,14 @@
RelativePath="..\platform\graphics\ca\win\PlatformCALayerWinInternal.h"
>
</File>
+ <File
+ RelativePath="..\platform\graphics\ca\win\WKCACFViewLayerTreeHost.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\graphics\ca\win\WKCACFViewLayerTreeHost.h"
+ >
+ </File>
</Filter>
</Filter>
</Filter>
diff --git a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
index 3633e01..18be0ea 100644
--- a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
@@ -32,6 +32,7 @@
#include "LayerChangesFlusher.h"
#include "LegacyCACFLayerTreeHost.h"
#include "PlatformCALayer.h"
+#include "WKCACFViewLayerTreeHost.h"
#include "WebCoreInstanceHandle.h"
#include <limits.h>
#include <wtf/CurrentTime.h>
@@ -96,7 +97,7 @@ bool CACFLayerTreeHost::acceleratedCompositingAvailable()
wcex.hInstance = WebCore::instanceHandle();
wcex.lpszClassName = L"CoreAnimationTesterWindowClass";
::RegisterClassEx(&wcex);
- HWND testWindow = ::CreateWindow(L"CoreAnimationTesterWindowClass", L"CoreAnimationTesterWindow", WS_POPUP, -500, -500, 0, 0, 0, 0, 0, 0);
+ HWND testWindow = ::CreateWindow(L"CoreAnimationTesterWindowClass", L"CoreAnimationTesterWindow", WS_POPUP, -500, -500, 20, 20, 0, 0, 0, 0);
if (!testWindow) {
available = false;
@@ -116,7 +117,9 @@ PassRefPtr<CACFLayerTreeHost> CACFLayerTreeHost::create()
{
if (!acceleratedCompositingAvailable())
return 0;
- RefPtr<CACFLayerTreeHost> host = LegacyCACFLayerTreeHost::create();
+ RefPtr<CACFLayerTreeHost> host = WKCACFViewLayerTreeHost::create();
+ if (!host)
+ host = LegacyCACFLayerTreeHost::create();
host->initialize();
return host.release();
}
@@ -292,10 +295,13 @@ void CACFLayerTreeHost::flushPendingLayerChangesNow()
// Flush changes stored up in PlatformCALayers to the context so they will be rendered.
flushContext();
+ m_isFlushingLayerChanges = false;
+}
+
+void CACFLayerTreeHost::contextDidChange()
+{
// All pending animations will have been started with the flush. Fire the animationStarted calls.
notifyAnimationsStarted();
-
- m_isFlushingLayerChanges = false;
}
void CACFLayerTreeHost::notifyAnimationsStarted()
diff --git a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
index 395e1fb..6d91a73 100644
--- a/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
@@ -78,6 +78,7 @@ protected:
virtual bool createRenderer() = 0;
virtual void destroyRenderer();
+ virtual void contextDidChange();
private:
void initialize();
diff --git a/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp b/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp
index 0309109..128d7a4 100644
--- a/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.cpp
@@ -189,7 +189,7 @@ bool LegacyCACFLayerTreeHost::createRenderer()
if (IsWindow(window())) {
rootLayer()->setBounds(bounds());
- wkCACFContextFlush(m_context);
+ flushContext();
}
return true;
@@ -221,7 +221,7 @@ void LegacyCACFLayerTreeHost::resize()
if (rootLayer()) {
rootLayer()->setBounds(bounds());
- wkCACFContextFlush(m_context);
+ flushContext();
}
}
@@ -326,6 +326,11 @@ void LegacyCACFLayerTreeHost::renderSoon()
void LegacyCACFLayerTreeHost::flushContext()
{
wkCACFContextFlush(m_context);
+ contextDidChange();
+}
+
+void LegacyCACFLayerTreeHost::contextDidChange()
+{
renderSoon();
}
diff --git a/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h b/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h
index aa642a4..bfa530b 100644
--- a/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/ca/win/LegacyCACFLayerTreeHost.h
@@ -60,6 +60,7 @@ private:
virtual void destroyRenderer();
virtual CFTimeInterval lastCommitTime() const;
virtual void flushContext();
+ virtual void contextDidChange();
virtual void paint();
virtual void render(const Vector<CGRect>& dirtyRects = Vector<CGRect>());
diff --git a/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp b/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp
new file mode 100644
index 0000000..e672c2d
--- /dev/null
+++ b/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2011 Apple 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. ``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 COMPUTER, INC. OR
+ * 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 "WKCACFViewLayerTreeHost.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "PlatformCALayer.h"
+#include "SoftLinking.h"
+#include <wtf/CurrentTime.h>
+
+typedef struct _CACFLayer* CACFLayerRef;
+
+namespace WebCore {
+
+#ifdef DEBUG_ALL
+SOFT_LINK_DEBUG_LIBRARY(WebKitQuartzCoreAdditions)
+#else
+SOFT_LINK_LIBRARY(WebKitQuartzCoreAdditions)
+#endif
+
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewCreate, WKCACFViewRef, __cdecl, (), ())
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewSetLayer, void, __cdecl, (WKCACFViewRef view, CACFLayerRef layer), (view, layer))
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewUpdate, void, __cdecl, (WKCACFViewRef view, HWND window, const CGRect* bounds), (view, window, bounds))
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewCanDraw, bool, __cdecl, (WKCACFViewRef view), (view))
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewDraw, void, __cdecl, (WKCACFViewRef view), (view))
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewFlushContext, void, __cdecl, (WKCACFViewRef view), (view))
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewInvalidateRects, void, __cdecl, (WKCACFViewRef view, const CGRect rects[], size_t count), (view, rects, count))
+typedef void (*WKCACFViewContextDidChangeCallback)(WKCACFViewRef view, void* info);
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewSetContextDidChangeCallback, void, __cdecl, (WKCACFViewRef view, WKCACFViewContextDidChangeCallback callback, void* info), (view, callback, info))
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewGetLastCommitTime, CFTimeInterval, __cdecl, (WKCACFViewRef view), (view))
+SOFT_LINK(WebKitQuartzCoreAdditions, WKCACFViewSetContextUserData, void, __cdecl, (WKCACFViewRef view, void* userData), (view, userData))
+
+PassRefPtr<WKCACFViewLayerTreeHost> WKCACFViewLayerTreeHost::create()
+{
+ if (!WebKitQuartzCoreAdditionsLibrary())
+ return 0;
+
+ return adoptRef(new WKCACFViewLayerTreeHost);
+}
+
+WKCACFViewLayerTreeHost::WKCACFViewLayerTreeHost()
+ : m_view(AdoptCF, WKCACFViewCreate())
+ , m_viewNeedsUpdate(true)
+{
+}
+
+void WKCACFViewLayerTreeHost::updateViewIfNeeded()
+{
+ if (!m_viewNeedsUpdate)
+ return;
+ m_viewNeedsUpdate = false;
+
+ CGRect layerBounds = rootLayer()->bounds();
+
+ CGRect bounds = this->bounds();
+ WKCACFViewUpdate(m_view.get(), window(), &bounds);
+
+ if (CGRectEqualToRect(layerBounds, rootLayer()->bounds()))
+ return;
+
+ // Flush the context so the layer's rendered bounds will match our bounds.
+ flushContext();
+}
+
+void WKCACFViewLayerTreeHost::contextDidChangeCallback(WKCACFViewRef view, void* info)
+{
+ ASSERT_ARG(view, view);
+ ASSERT_ARG(info, info);
+
+ WKCACFViewLayerTreeHost* host = static_cast<WKCACFViewLayerTreeHost*>(info);
+ ASSERT_ARG(view, view == host->m_view);
+ host->contextDidChange();
+}
+
+void WKCACFViewLayerTreeHost::contextDidChange()
+{
+ // Tell the WKCACFView to start rendering now that we have some contents to render.
+ updateViewIfNeeded();
+
+ CACFLayerTreeHost::contextDidChange();
+}
+
+void WKCACFViewLayerTreeHost::initializeContext(void* userData, PlatformCALayer* layer)
+{
+ WKCACFViewSetContextUserData(m_view.get(), userData);
+ WKCACFViewSetLayer(m_view.get(), layer->platformLayer());
+ WKCACFViewSetContextDidChangeCallback(m_view.get(), contextDidChangeCallback, this);
+}
+
+void WKCACFViewLayerTreeHost::resize()
+{
+ m_viewNeedsUpdate = true;
+}
+
+bool WKCACFViewLayerTreeHost::createRenderer()
+{
+ updateViewIfNeeded();
+ return WKCACFViewCanDraw(m_view.get());
+}
+
+void WKCACFViewLayerTreeHost::destroyRenderer()
+{
+ m_viewNeedsUpdate = true;
+ WKCACFViewUpdate(m_view.get(), 0, 0);
+ WKCACFViewSetContextUserData(m_view.get(), 0);
+ WKCACFViewSetLayer(m_view.get(), 0);
+ WKCACFViewSetContextDidChangeCallback(m_view.get(), 0, 0);
+
+ CACFLayerTreeHost::destroyRenderer();
+}
+
+CFTimeInterval WKCACFViewLayerTreeHost::lastCommitTime() const
+{
+ return WKCACFViewGetLastCommitTime(m_view.get());
+}
+
+void WKCACFViewLayerTreeHost::flushContext()
+{
+ WKCACFViewFlushContext(m_view.get());
+}
+
+void WKCACFViewLayerTreeHost::paint()
+{
+ updateViewIfNeeded();
+ CACFLayerTreeHost::paint();
+}
+
+void WKCACFViewLayerTreeHost::render(const Vector<CGRect>& dirtyRects)
+{
+ WKCACFViewInvalidateRects(m_view.get(), dirtyRects.data(), dirtyRects.size());
+ WKCACFViewDraw(m_view.get());
+}
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h b/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h
new file mode 100644
index 0000000..af09f76
--- /dev/null
+++ b/Source/WebCore/platform/graphics/ca/win/WKCACFViewLayerTreeHost.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2011 Apple 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. ``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 COMPUTER, INC. OR
+ * 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 WKCACFViewLayerTreeHost_h
+#define WKCACFViewLayerTreeHost_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "CACFLayerTreeHost.h"
+
+typedef struct _WKCACFView* WKCACFViewRef;
+
+namespace WebCore {
+
+class WKCACFViewLayerTreeHost : public CACFLayerTreeHost {
+public:
+ static PassRefPtr<WKCACFViewLayerTreeHost> create();
+
+private:
+ WKCACFViewLayerTreeHost();
+
+ void updateViewIfNeeded();
+ static void contextDidChangeCallback(WKCACFViewRef, void* info);
+
+ virtual void initializeContext(void* userData, PlatformCALayer*);
+ virtual void resize();
+ virtual bool createRenderer();
+ virtual void destroyRenderer();
+ virtual void flushContext();
+ virtual void contextDidChange();
+ virtual void paint();
+ virtual void render(const Vector<CGRect>& dirtyRects = Vector<CGRect>());
+ virtual CFTimeInterval lastCommitTime() const;
+
+ RetainPtr<WKCACFViewRef> m_view;
+ bool m_viewNeedsUpdate;
+};
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif // WKCACFViewLayerTreeHost_h
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list