From ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 24 Feb 2012 16:36:50 +0100 Subject: Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790) --- Source/WebKit/win/WebView.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Source/WebKit/win/WebView.cpp') diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp index 57acc1318..5927c9664 100644 --- a/Source/WebKit/win/WebView.cpp +++ b/Source/WebKit/win/WebView.cpp @@ -2072,6 +2072,23 @@ void WebView::setIsBeingDestroyed() ::SetWindowLongPtrW(m_viewWindow, 0, 0); } +void WebView::setShouldInvertColors(bool shouldInvertColors) +{ + if (m_shouldInvertColors == shouldInvertColors) + return; + + m_shouldInvertColors = shouldInvertColors; + +#if USE(ACCELERATED_COMPOSITING) + if (m_layerTreeHost) + m_layerTreeHost->setShouldInvertColors(shouldInvertColors); +#endif + + RECT windowRect = {0}; + frameRect(&windowRect); + repaint(windowRect, true, true); +} + bool WebView::registerWebViewWindowClass() { static bool haveRegisteredWindowClass = false; @@ -4922,6 +4939,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) return hr; settings->setMediaPlaybackAllowsInline(enabled); + hr = prefsPrivate->shouldInvertColors(&enabled); + if (FAILED(hr)) + return hr; + setShouldInvertColors(enabled); + return S_OK; } @@ -6463,6 +6485,8 @@ void WebView::setAcceleratedCompositing(bool accelerated) if (m_layerTreeHost) { m_isAcceleratedCompositing = true; + m_layerTreeHost->setShouldInvertColors(m_shouldInvertColors); + m_layerTreeHost->setClient(this); ASSERT(m_viewWindow); m_layerTreeHost->setWindow(m_viewWindow); -- cgit v1.2.1