diff options
author | Ben Murdoch <benm@google.com> | 2011-05-16 16:25:10 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-23 18:54:14 +0100 |
commit | ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch) | |
tree | db769fadd053248f85db67434a5b275224defef7 /Source/WebKit/win | |
parent | 52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff) | |
download | external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2 |
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebKit/win')
-rw-r--r-- | Source/WebKit/win/COMEnumVariant.h | 4 | ||||
-rw-r--r-- | Source/WebKit/win/COMPropertyBag.h | 3 | ||||
-rw-r--r-- | Source/WebKit/win/ChangeLog | 149 | ||||
-rw-r--r-- | Source/WebKit/win/FullscreenVideoController.h | 3 | ||||
-rw-r--r-- | Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/win/WebCoreSupport/WebDragClient.cpp | 1 | ||||
-rw-r--r-- | Source/WebKit/win/WebDatabaseManager.cpp | 6 | ||||
-rw-r--r-- | Source/WebKit/win/WebInspector.h | 3 | ||||
-rw-r--r-- | Source/WebKit/win/WebLocalizableStrings.cpp | 3 | ||||
-rw-r--r-- | Source/WebKit/win/WebPreferenceKeysPrivate.h | 1 | ||||
-rw-r--r-- | Source/WebKit/win/WebPreferences.cpp | 11 | ||||
-rw-r--r-- | Source/WebKit/win/WebScriptWorld.h | 3 | ||||
-rw-r--r-- | Source/WebKit/win/WebScrollBar.cpp | 21 | ||||
-rw-r--r-- | Source/WebKit/win/WebScrollBar.h | 18 | ||||
-rw-r--r-- | Source/WebKit/win/WebSerializedJSValue.h | 3 | ||||
-rw-r--r-- | Source/WebKit/win/WebUserContentURLPattern.h | 3 | ||||
-rw-r--r-- | Source/WebKit/win/WebView.cpp | 67 | ||||
-rw-r--r-- | Source/WebKit/win/WebView.h | 13 |
18 files changed, 237 insertions, 77 deletions
diff --git a/Source/WebKit/win/COMEnumVariant.h b/Source/WebKit/win/COMEnumVariant.h index a93a3c2..6725107 100644 --- a/Source/WebKit/win/COMEnumVariant.h +++ b/Source/WebKit/win/COMEnumVariant.h @@ -29,12 +29,12 @@ #define NOMINMAX #include <unknwn.h> -#include <wtf/Noncopyable.h> #include "COMVariantSetter.h" template<typename ContainerType> -class COMEnumVariant : public IEnumVARIANT, public Noncopyable { +class COMEnumVariant : public IEnumVARIANT { + WTF_MAKE_NONCOPYABLE(COMEnumVariant); public: static COMEnumVariant* adopt(ContainerType&); static COMEnumVariant* createInstance(const ContainerType&); diff --git a/Source/WebKit/win/COMPropertyBag.h b/Source/WebKit/win/COMPropertyBag.h index 610c367..620458e 100644 --- a/Source/WebKit/win/COMPropertyBag.h +++ b/Source/WebKit/win/COMPropertyBag.h @@ -35,7 +35,8 @@ #include "COMVariantSetter.h"
template<typename ValueType, typename KeyType = typename WTF::String, typename HashType = typename WTF::StringHash>
-class COMPropertyBag : public IPropertyBag, public IPropertyBag2, Noncopyable {
+class COMPropertyBag : public IPropertyBag, public IPropertyBag2 {
+ WTF_MAKE_NONCOPYABLE(COMPropertyBag);
public:
typedef HashMap<KeyType, ValueType, HashType> HashMapType;
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog index f26f0f2..6a3b53c 100644 --- a/Source/WebKit/win/ChangeLog +++ b/Source/WebKit/win/ChangeLog @@ -1,3 +1,152 @@ +2011-01-21 Chris Rogers <crogers@google.com> + + Reviewed by Darin Fisher. + + Add run-time enable support for the web audio API + https://bugs.webkit.org/show_bug.cgi?id=52741 + + * WebPreferenceKeysPrivate.h: + * WebView.cpp: + (WebView::notifyPreferencesChanged): + +2011-01-21 Sam Weinig <sam@webkit.org> + + Fix windows build. + + * WebScrollBar.h: + +2011-01-21 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship" + https://bugs.webkit.org/show_bug.cgi?id=52779 + + Rename ScrollbarClient -> ScrollableArea. + + * WebScrollBar.cpp: + (WebScrollBar::scroll): + * WebScrollBar.h: + +2011-01-20 Adam Roben <aroben@apple.com> + + Update for CACFLayerTreeHost changes + + Fixes <http://webkit.org/b/52852> Flushing layer changes and rendering are intertwined in + CACFLayerTreeHost, but shouldn't be + + Reviewed by Simon Fraser. + + * WebView.cpp: + (WebView::paint): Changed to flush layer changes via CACFLayerTreeHost, which will call back + to our own flushing function if needed. + + * WebView.h: Removed shouldRender, which is no longer used or needed. + +2011-01-21 Adam Roben <aroben@apple.com> + + Update for WKCACFLayerRenderer -> CACFLayerTreeHost rename + + Also renamed WebView::m_layerRenderer to WebView::m_layerTreeHost to match. + + Fixes <http://webkit.org/b/52898> WKCACFLayerRenderer sounds like a render object, but isn't + + Reviewed by Simon Fraser. + + * WebPreferences.cpp: + * WebView.cpp: + (WebView::setAcceleratedCompositing): Also made sure to remove our HWND from the layer tree + host before we get rid of the layer tree host itself. + * WebView.h: + +2011-01-21 Adam Roben <aroben@apple.com> + + Replace some "sync compositing state" terminology with "flush pending GraphicsLayer changes" + + This seems to be the direction in which our code is moving. I chose "GraphicsLayer" as + opposed to just "layer" because there are cases where we flush changes to CACFLayers that + don't have a corresponding GraphicsLayer. + + Fixes <http://webkit.org/b/52894> "Sync compositing state" terminology in + WKCACFLayerRenderer and friends is confusing + + Reviewed by Simon Fraser. + + * WebCoreSupport/WebChromeClient.cpp: + (WebChromeClient::scheduleCompositingLayerSync): Updated for WebView changes. + + * WebView.cpp: + (WebView::paint): Updated for rename. + (WebView::flushPendingGraphicsLayerChangesSoon): Renamed from scheduleCompositingLayerSync. + (WebView::notifySyncRequired): Updated for rename. + (WebView::flushPendingGraphicsLayerChanges): Renamed from syncCompositingState. + + * WebView.h: Did the renames. + +2011-01-20 Sam Weinig <sam@webkit.org> + + Reviewed by Dave Hyatt. + + Cleanup Scrollbar/ScrollbarClient relationship + https://bugs.webkit.org/show_bug.cgi?id=52779 + + * WebScrollBar.cpp: + (WebScrollBar::WebScrollBar): + (WebScrollBar::setValue): + (WebScrollBar::value): + (WebScrollBar::scroll): + (WebScrollBar::scrollPosition): + (WebScrollBar::setScrollOffset): + * WebScrollBar.h: + +2011-01-19 Adam Roben <aroben@apple.com> + + Update for WKCACFLayerRenderer changes + + Fixes <http://webkit.org/b/52749> WKCACFLayerRenderer should be + ref-counted + + Reviewed by Simon Fraser. + + * WebView.cpp: + (WebView::~WebView): Added some assertions to make sure we've gotten rid of our + compositing-related members. My biggest concern was making sure that m_layerRenderer was + gone, which would also mean we had nulled out its client pointer. + (WebView::setAcceleratedCompositing): Changed to call WKCACFLayerRenderer::setClient instead + of passing the client into create(), and to clear out the client before nulling out + m_layerRenderer. + + * WebView.h: Changed m_layerRenderer from an OwnPtr to a RefPtr. + +2011-01-19 Adam Roben <aroben@apple.com> + + Teach WebView::scrollBackingStore about compositing mode + + Test: + compositing/scroll-painted-composited-content.html + + Fixes <http://webkit.org/b/52720> REGRESSION (r75987): Assertion failure in + WebView::scrollBackingStore when scrolling page with composited content + + Reviewed by Anders Carlsson. + + * WebView.cpp: + (WebView::scrollBackingStore): Do something sensible (though naive) when in compositing + mode, rather than incorrectly asserting that this function is never called in that case. For + now we just repaint the entire scrolled region; someday hopefully we can avoid having to + repaint the areas that have just been moved. + +2011-01-19 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Sam Weinig. + + GraphicsLayers in subframes can get sync'd multiple times + https://bugs.webkit.org/show_bug.cgi?id=52489 + + * WebView.cpp: + (WebView::syncCompositingState): syncCompositingStateRecursive() + was renamed to syncCompositingStateIncludingSubframes(). + 2011-01-17 Adam Roben <aroben@apple.com> Update for WKCACFLayerRenderer changes diff --git a/Source/WebKit/win/FullscreenVideoController.h b/Source/WebKit/win/FullscreenVideoController.h index 6b56ab5..a65529e 100644 --- a/Source/WebKit/win/FullscreenVideoController.h +++ b/Source/WebKit/win/FullscreenVideoController.h @@ -102,7 +102,8 @@ private: int m_dragStartOffset; }; -class FullscreenVideoController : WebCore::MediaPlayerPrivateFullscreenClient, public Noncopyable { +class FullscreenVideoController : WebCore::MediaPlayerPrivateFullscreenClient { + WTF_MAKE_NONCOPYABLE(FullscreenVideoController); public: FullscreenVideoController(); virtual ~FullscreenVideoController(); diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp index 6460b4a..f5cce4e 100644 --- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp +++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp @@ -826,7 +826,7 @@ void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graph void WebChromeClient::scheduleCompositingLayerSync() { - m_webView->scheduleCompositingLayerSync(); + m_webView->flushPendingGraphicsLayerChangesSoon(); } #endif diff --git a/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp b/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp index f4d9842..184df95 100644 --- a/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp +++ b/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp @@ -43,6 +43,7 @@ #include <WebCore/Page.h> #include <WebCore/Settings.h> #include <WebCore/StringTruncator.h> +#include <WebCore/TextRun.h> #include <WebCore/WebCoreTextRenderer.h> #pragma warning(pop) diff --git a/Source/WebKit/win/WebDatabaseManager.cpp b/Source/WebKit/win/WebDatabaseManager.cpp index bdcb549..e2b81e1 100644 --- a/Source/WebKit/win/WebDatabaseManager.cpp +++ b/Source/WebKit/win/WebDatabaseManager.cpp @@ -52,7 +52,8 @@ static inline bool isEqual(LPCWSTR s1, LPCWSTR s2) return !wcscmp(s1, s2); } -class DatabaseDetailsPropertyBag : public IPropertyBag, public Noncopyable { +class DatabaseDetailsPropertyBag : public IPropertyBag { + WTF_MAKE_NONCOPYABLE(DatabaseDetailsPropertyBag); public: static DatabaseDetailsPropertyBag* createInstance(const DatabaseDetails&); @@ -328,7 +329,8 @@ HRESULT STDMETHODCALLTYPE WebDatabaseManager::deleteDatabase( return S_OK; } -class DidModifyOriginData : public Noncopyable { +class DidModifyOriginData { + WTF_MAKE_NONCOPYABLE(DidModifyOriginData); public: static void dispatchToMainThread(WebDatabaseManager* databaseManager, SecurityOrigin* origin) { diff --git a/Source/WebKit/win/WebInspector.h b/Source/WebKit/win/WebInspector.h index 053a593..e2d2fcd 100644 --- a/Source/WebKit/win/WebInspector.h +++ b/Source/WebKit/win/WebInspector.h @@ -34,7 +34,8 @@ class WebView; -class WebInspector : public IWebInspector, public IWebInspectorPrivate, public Noncopyable { +class WebInspector : public IWebInspector, public IWebInspectorPrivate { + WTF_MAKE_NONCOPYABLE(WebInspector); public: static WebInspector* createInstance(WebView*); diff --git a/Source/WebKit/win/WebLocalizableStrings.cpp b/Source/WebKit/win/WebLocalizableStrings.cpp index da6b221..e9b99ad 100644 --- a/Source/WebKit/win/WebLocalizableStrings.cpp +++ b/Source/WebKit/win/WebLocalizableStrings.cpp @@ -72,7 +72,8 @@ static LocalizedStringMap frameworkLocStrings() return map; } -class LocalizedString : public Noncopyable { +class LocalizedString { + WTF_MAKE_NONCOPYABLE(LocalizedString); public: LocalizedString(CFStringRef string) : m_cfString(string) diff --git a/Source/WebKit/win/WebPreferenceKeysPrivate.h b/Source/WebKit/win/WebPreferenceKeysPrivate.h index 0b781d8..be0ebe5 100644 --- a/Source/WebKit/win/WebPreferenceKeysPrivate.h +++ b/Source/WebKit/win/WebPreferenceKeysPrivate.h @@ -67,6 +67,7 @@ #define WebKitCacheModelPreferenceKey "WebKitCacheModelPreferenceKey" #define WebKitLocalStorageDatabasePathPreferenceKey "WebKitLocalStorageDatabasePath" #define WebKitHyperlinkAuditingEnabledPreferenceKey "WebKitHyperlinkAuditingEnabled" +#define WebKitWebAudioEnabledPreferenceKey "WebKitWebAudioEnabled" // These are private both because callers should be using the cover methods and because the // cover methods themselves are private. diff --git a/Source/WebKit/win/WebPreferences.cpp b/Source/WebKit/win/WebPreferences.cpp index 5a2c19b..a962471 100644 --- a/Source/WebKit/win/WebPreferences.cpp +++ b/Source/WebKit/win/WebPreferences.cpp @@ -29,23 +29,22 @@ #include "WebPreferences.h" #include "COMPtr.h" +#include "WebLocalizableStrings.h" #include "WebNotificationCenter.h" #include "WebPreferenceKeysPrivate.h" -#include <wtf/text/StringHash.h> +#include <CoreFoundation/CoreFoundation.h> +#include <WebCore/CACFLayerTreeHost.h> #include <WebCore/FileSystem.h> #include <WebCore/Font.h> #include <WebCore/PlatformString.h> -#include <WebCore/WKCACFLayerRenderer.h> -#include "WebLocalizableStrings.h" - -#include <CoreFoundation/CoreFoundation.h> #include <limits> #include <shlobj.h> #include <tchar.h> #include <wtf/HashMap.h> #include <wtf/OwnArrayPtr.h> #include <wtf/text/CString.h> +#include <wtf/text/StringHash.h> #if PLATFORM(CG) #include <CoreGraphics/CoreGraphics.h> @@ -1446,7 +1445,7 @@ HRESULT WebPreferences::setAcceleratedCompositingEnabled(BOOL enabled) HRESULT WebPreferences::acceleratedCompositingEnabled(BOOL* enabled) { #if USE(ACCELERATED_COMPOSITING) - *enabled = WKCACFLayerRenderer::acceleratedCompositingAvailable() && boolValueForKey(CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey)); + *enabled = CACFLayerTreeHost::acceleratedCompositingAvailable() && boolValueForKey(CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey)); #else *enabled = FALSE; #endif diff --git a/Source/WebKit/win/WebScriptWorld.h b/Source/WebKit/win/WebScriptWorld.h index f088a72..01511de 100644 --- a/Source/WebKit/win/WebScriptWorld.h +++ b/Source/WebKit/win/WebScriptWorld.h @@ -31,7 +31,8 @@ namespace WebCore { class DOMWrapperWorld; } -class WebScriptWorld : public Noncopyable, public IWebScriptWorld { +class WebScriptWorld : public IWebScriptWorld { + WTF_MAKE_NONCOPYABLE(WebScriptWorld); public: static WebScriptWorld* standardWorld(); static COMPtr<WebScriptWorld> createInstance(); diff --git a/Source/WebKit/win/WebScrollBar.cpp b/Source/WebKit/win/WebScrollBar.cpp index 8613c1c..45bc8f3 100644 --- a/Source/WebKit/win/WebScrollBar.cpp +++ b/Source/WebKit/win/WebScrollBar.cpp @@ -42,6 +42,7 @@ using namespace WebCore; WebScrollBar::WebScrollBar() : m_refCount(0) , m_containingWindow(0) + , m_currentPosition(0) { gClassCount++; gClassNameCount.add("WebScrollBar"); @@ -143,7 +144,7 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::setRect( HRESULT STDMETHODCALLTYPE WebScrollBar::setValue( /* [in] */ int value) { - m_scrollBar->setValue(value, Scrollbar::NotFromScrollAnimator); + m_currentPosition = value; return S_OK; } @@ -152,7 +153,7 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::value( { if (!value) return E_POINTER; - *value = m_scrollBar->value(); + *value = m_currentPosition; return S_OK; } @@ -247,27 +248,25 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::scroll( { ScrollDirection webCoreScrollDirection = (ScrollDirection) direction; ScrollGranularity webCoreGranularity = (ScrollGranularity) granularity; - m_scrollBar->scroll(webCoreScrollDirection, webCoreGranularity, multiplier); + ScrollableArea::scroll(webCoreScrollDirection, webCoreGranularity, multiplier); return S_OK; } -// ScrollbarClient ------------------------------------------------------- +// ScrollableArea ------------------------------------------------------- + int WebScrollBar::scrollSize(ScrollbarOrientation orientation) const { return (orientation == m_scrollBar->orientation()) ? (m_scrollBar->totalSize() - m_scrollBar->visibleSize()) : 0; } -void WebScrollBar::setScrollOffsetFromAnimation(const IntPoint& offset) +int WebScrollBar::scrollPosition(Scrollbar*) const { - m_scrollBar->setValue((m_scrollBar->orientation() == HorizontalScrollbar) ? offset.x() : offset.y(), Scrollbar::FromScrollAnimator); + return m_currentPosition; } -void WebScrollBar::valueChanged(Scrollbar* scrollBar) +void WebScrollBar::setScrollOffset(const IntPoint& offset) { - if (m_scrollBar != scrollBar) { - ASSERT(false); // shouldn't happen - return; - } + m_currentPosition = (m_scrollBar->orientation() == HorizontalScrollbar) ? offset.x() : offset.y(); m_delegate->valueChanged(this); } diff --git a/Source/WebKit/win/WebScrollBar.h b/Source/WebKit/win/WebScrollBar.h index 90f2491..ca44e8b 100644 --- a/Source/WebKit/win/WebScrollBar.h +++ b/Source/WebKit/win/WebScrollBar.h @@ -34,17 +34,14 @@ #pragma warning(push, 0) #include <WebCore/COMPtr.h> #include <WebCore/Scrollbar.h> -#include <WebCore/ScrollbarClient.h> +#include <WebCore/ScrollableArea.h> #pragma warning(pop) namespace WebCore { class Scrollbar; } -using namespace WebCore; - -class WebScrollBar : public IWebScrollBarPrivate, ScrollbarClient -{ +class WebScrollBar : public IWebScrollBarPrivate, WebCore::ScrollableArea { public: static WebScrollBar* createInstance(); protected: @@ -115,11 +112,11 @@ public: /* [in] */ float multiplier); protected: - // ScrollbarClient - virtual int scrollSize(ScrollbarOrientation orientation) const; - virtual void setScrollOffsetFromAnimation(const IntPoint&); - virtual void valueChanged(Scrollbar*); - virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); + // ScrollableArea + virtual int scrollSize(WebCore::ScrollbarOrientation) const; + virtual int scrollPosition(WebCore::Scrollbar*) const; + virtual void setScrollOffset(const WebCore::IntPoint&); + virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); // FIXME: We should provide a way to set this value. virtual bool isActive() const { return true; } @@ -128,6 +125,7 @@ protected: ULONG m_refCount; HWND m_containingWindow; + int m_currentPosition; RefPtr<WebCore::Scrollbar> m_scrollBar; COMPtr<IWebScrollBarDelegatePrivate> m_delegate; }; diff --git a/Source/WebKit/win/WebSerializedJSValue.h b/Source/WebKit/win/WebSerializedJSValue.h index a2d6d56..6e3747d 100644 --- a/Source/WebKit/win/WebSerializedJSValue.h +++ b/Source/WebKit/win/WebSerializedJSValue.h @@ -34,7 +34,8 @@ namespace WebCore { class SerializedScriptValue; } -class WebSerializedJSValue : public Noncopyable, public IWebSerializedJSValue, public IWebSerializedJSValuePrivate { +class WebSerializedJSValue : public IWebSerializedJSValue, public IWebSerializedJSValuePrivate { + WTF_MAKE_NONCOPYABLE(WebSerializedJSValue); public: static COMPtr<WebSerializedJSValue> createInstance(); diff --git a/Source/WebKit/win/WebUserContentURLPattern.h b/Source/WebKit/win/WebUserContentURLPattern.h index e8f6b67..42854b4 100644 --- a/Source/WebKit/win/WebUserContentURLPattern.h +++ b/Source/WebKit/win/WebUserContentURLPattern.h @@ -32,7 +32,8 @@ namespace WebCore { class UserContentURLPattern; } -class WebUserContentURLPattern : public Noncopyable, public IWebUserContentURLPattern { +class WebUserContentURLPattern : public IWebUserContentURLPattern { + WTF_MAKE_NONCOPYABLE(WebUserContentURLPattern); public: static COMPtr<WebUserContentURLPattern> createInstance(); diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp index ae91724..da88be4 100644 --- a/Source/WebKit/win/WebView.cpp +++ b/Source/WebKit/win/WebView.cpp @@ -387,6 +387,11 @@ WebView::~WebView() ASSERT(!m_preferences); ASSERT(!m_viewWindow); +#if USE(ACCELERATED_COMPOSITING) + ASSERT(!m_layerTreeHost); + ASSERT(!m_backingLayer); +#endif + WebViewCount--; gClassCount--; gClassNameCount.remove("WebView"); @@ -819,7 +824,12 @@ void WebView::addToDirtyRegion(HRGN newRegion) void WebView::scrollBackingStore(FrameView* frameView, int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect) { #if USE(ACCELERATED_COMPOSITING) - ASSERT(!isAcceleratedCompositing()); + if (isAcceleratedCompositing()) { + // FIXME: We should be doing something smarter here, like moving tiles around and painting + // any newly-exposed tiles. <http://webkit.org/b/52714> + m_backingLayer->setNeedsDisplayInRect(scrollViewRect); + return; + } #endif LOCAL_GDI_COUNTER(0, __FUNCTION__); @@ -873,8 +883,8 @@ void WebView::sizeChanged(const IntSize& newSize) coreFrame->view()->resize(newSize); #if USE(ACCELERATED_COMPOSITING) - if (m_layerRenderer) - m_layerRenderer->resize(); + if (m_layerTreeHost) + m_layerTreeHost->resize(); if (m_backingLayer) { m_backingLayer->setSize(newSize); m_backingLayer->setNeedsDisplay(); @@ -980,11 +990,11 @@ void WebView::paint(HDC dc, LPARAM options) #if USE(ACCELERATED_COMPOSITING) if (isAcceleratedCompositing()) { - syncCompositingState(); - // Syncing might have taken us out of compositing mode. + m_layerTreeHost->flushPendingLayerChangesNow(); + // Flushing might have taken us out of compositing mode. if (isAcceleratedCompositing()) { // FIXME: We need to paint into dc (if provided). <http://webkit.org/b/52578> - m_layerRenderer->paint(); + m_layerTreeHost->paint(); ::ValidateRect(m_viewWindow, 0); return; } @@ -4792,6 +4802,10 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) return hr; settings->setShowRepaintCounter(enabled); +#if ENABLE(WEB_AUDIO) + settings->setWebAudioEnabled(true); +#endif // ENABLE(WEB_AUDIO) + #if ENABLE(3D_CANVAS) settings->setWebGLEnabled(true); #endif // ENABLE(3D_CANVAS) @@ -6262,26 +6276,26 @@ void WebView::setRootChildLayer(GraphicsLayer* layer) m_backingLayer->addChild(layer); } -void WebView::scheduleCompositingLayerSync() +void WebView::flushPendingGraphicsLayerChangesSoon() { - if (!m_layerRenderer) + if (!m_layerTreeHost) return; - m_layerRenderer->syncCompositingStateSoon(); + m_layerTreeHost->flushPendingGraphicsLayerChangesSoon(); } void WebView::setAcceleratedCompositing(bool accelerated) { - if (m_isAcceleratedCompositing == accelerated || !WKCACFLayerRenderer::acceleratedCompositingAvailable()) + if (m_isAcceleratedCompositing == accelerated || !CACFLayerTreeHost::acceleratedCompositingAvailable()) return; if (accelerated) { - m_layerRenderer = WKCACFLayerRenderer::create(this); - if (m_layerRenderer) { + m_layerTreeHost = CACFLayerTreeHost::create(); + if (m_layerTreeHost) { m_isAcceleratedCompositing = true; - // Create the root layer + m_layerTreeHost->setClient(this); ASSERT(m_viewWindow); - m_layerRenderer->setHostWindow(m_viewWindow); + m_layerTreeHost->setWindow(m_viewWindow); // FIXME: We could perhaps get better performance by never allowing this layer to // become tiled (or choosing a higher-than-normal tiling threshold). @@ -6294,7 +6308,7 @@ void WebView::setAcceleratedCompositing(bool accelerated) m_backingLayer->setSize(IntRect(clientRect).size()); m_backingLayer->setNeedsDisplay(); - m_layerRenderer->setRootChildLayer(PlatformCALayer::platformCALayer(m_backingLayer->platformLayer())); + m_layerTreeHost->setRootChildLayer(PlatformCALayer::platformCALayer(m_backingLayer->platformLayer())); // We aren't going to be using our backing store while we're in accelerated compositing // mode. But don't delete it immediately, in case we switch out of accelerated @@ -6302,7 +6316,10 @@ void WebView::setAcceleratedCompositing(bool accelerated) deleteBackingStoreSoon(); } } else { - m_layerRenderer = 0; + ASSERT(m_layerTreeHost); + m_layerTreeHost->setClient(0); + m_layerTreeHost->setWindow(0); + m_layerTreeHost = 0; m_backingLayer = 0; m_isAcceleratedCompositing = false; } @@ -6468,7 +6485,7 @@ void WebView::notifyAnimationStarted(const GraphicsLayer*, double) void WebView::notifySyncRequired(const GraphicsLayer*) { - scheduleCompositingLayerSync(); + flushPendingGraphicsLayerChangesSoon(); } void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& inClip) @@ -6493,19 +6510,7 @@ bool WebView::showRepaintCounter() const return m_page->settings()->showRepaintCounter(); } -bool WebView::shouldRender() const -{ - Frame* coreFrame = core(m_mainFrame); - if (!coreFrame) - return true; - FrameView* frameView = coreFrame->view(); - if (!frameView) - return true; - - return !frameView->layoutPending(); -} - -void WebView::syncCompositingState() +void WebView::flushPendingGraphicsLayerChanges() { Frame* coreFrame = core(m_mainFrame); if (!coreFrame) @@ -6522,7 +6527,7 @@ void WebView::syncCompositingState() if (m_backingLayer) m_backingLayer->syncCompositingStateForThisLayerOnly(); - view->syncCompositingStateRecursive(); + view->syncCompositingStateIncludingSubframes(); } #endif diff --git a/Source/WebKit/win/WebView.h b/Source/WebKit/win/WebView.h index f775eaf..1a993c6 100644 --- a/Source/WebKit/win/WebView.h +++ b/Source/WebKit/win/WebView.h @@ -40,8 +40,8 @@ #include <wtf/RefPtr.h> #if USE(ACCELERATED_COMPOSITING) +#include <WebCore/CACFLayerTreeHost.h> #include <WebCore/PlatformCALayer.h> -#include <WebCore/WKCACFLayerRenderer.h> #endif class FullscreenVideoController; @@ -71,7 +71,7 @@ class WebView , WebCore::WindowMessageListener #if USE(ACCELERATED_COMPOSITING) , WebCore::GraphicsLayerClient - , WebCore::WKCACFLayerRendererClient + , WebCore::CACFLayerTreeHostClient #endif { public: @@ -905,7 +905,7 @@ public: void downloadURL(const WebCore::KURL&); #if USE(ACCELERATED_COMPOSITING) - void scheduleCompositingLayerSync(); + void flushPendingGraphicsLayerChangesSoon(); void setRootChildLayer(WebCore::GraphicsLayer*); #endif @@ -947,9 +947,8 @@ private: virtual bool showDebugBorders() const; virtual bool showRepaintCounter() const; - // WKCACFLayerRendererClient - virtual bool shouldRender() const; - virtual void syncCompositingState(); + // CACFLayerTreeHostClient + virtual void flushPendingGraphicsLayerChanges(); #endif protected: @@ -1056,7 +1055,7 @@ protected: bool isAcceleratedCompositing() const { return m_isAcceleratedCompositing; } void setAcceleratedCompositing(bool); - OwnPtr<WebCore::WKCACFLayerRenderer> m_layerRenderer; + RefPtr<WebCore::CACFLayerTreeHost> m_layerTreeHost; OwnPtr<WebCore::GraphicsLayer> m_backingLayer; bool m_isAcceleratedCompositing; #endif |