Source/WebCore:
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 00:07:40 +0000 (00:07 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 00:07:40 +0000 (00:07 +0000)
[Win] Show tiled drawing debug overlay on Windows
https://bugs.webkit.org/show_bug.cgi?id=149426

Reviewed by Dean Jackson.

No new tests: No change in behavior.

* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator): Revise signature to accept
a scale value and a font size.
(WebCore::PlatformCALayer::drawTextAtPoint): Revise signature for new arguments.
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::drawTileMapContents): Removing scaling and text drawing code,
and call common CALayer drawing routine.
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::create): Switch to nullptr.
(WebCore::CACFLayerTreeHost::CACFLayerTreeHost): Switch to C++14 initializers.
(WebCore::CACFLayerTreeHost::setPage): Added.
(WebCore::CACFLayerTreeHost::rootLayer): Update debug info layer if requested by settings.
(WebCore::CACFLayerTreeHost::layerTreeDidChange): Ditto.
(WebCore::CACFLayerTreeHost::mainFrameTiledBacking): Added.
(WebCore::CACFLayerTreeHost::updateDbugInfoLayer): Added.
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(WebCore::PlatformCALayerWin::drawTextAtPoint): Revised signature for new arguments. Use
argument for font size (rather than hard-coded '18'). Adjust font size by passed scale value.
* platform/graphics/ca/win/PlatformCALayerWin.h:

Source/WebKit/win:
[Win] Show tiled drawing debug overlay on Windows
https://bugs.webkit.org/show_bug.cgi?id=149426

Reviewed by Dean Jackson.

* Interfaces/IWebPreferencesPrivate.idl: Add new IWebPreferencesPrivate3 API version
so we can add new methods this cycle.
* WebPreferenceKeysPrivate.h: Add key for 'WebKitShowTiledScrollingIndicator'
* WebPreferences.cpp:
(WebPreferences::QueryInterface): Recognize the new IWebPreferencesPrivate3 API.
(WebPreferences::showTiledScrollingIndicator): Added.
(WebPreferences::setShowTiledScrollingIndicator): Ditto.
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged): Update to recognize 'showTiledScrollingIndicator'.
(WebView::setAcceleratedCompositing): Link the CACFLayerTreeHost to the WebCore Page object
so that it can see settings information.

Tools:
Remove 'nullable' to fix older iOS builds.

Patch by Simon Fraser <simon.fraser@apple.com> on 2015-09-21

* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView scrollViewDidEndZooming:withView:atScale:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190091 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/TileGrid.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKit/win/WebPreferenceKeysPrivate.h
Source/WebKit/win/WebPreferences.cpp
Source/WebKit/win/WebPreferences.h
Source/WebKit/win/WebView.cpp
Tools/ChangeLog
Tools/MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLib.rc
Tools/MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLibResource.h
Tools/MiniBrowser/win/Common.cpp
Tools/MiniBrowser/win/MiniBrowser.h

index 0f872fc628c886bc8ece9e4a52ac79f2c0473edb..e004906e3215877d6bd812d502aa06795adcb4ab 100644 (file)
@@ -1,3 +1,34 @@
+2015-09-21  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Show tiled drawing debug overlay on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=149426
+
+        Reviewed by Dean Jackson.
+
+        No new tests: No change in behavior.
+
+        * platform/graphics/ca/PlatformCALayer.cpp:
+        (WebCore::PlatformCALayer::drawRepaintIndicator): Revise signature to accept
+        a scale value and a font size.
+        (WebCore::PlatformCALayer::drawTextAtPoint): Revise signature for new arguments.
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::drawTileMapContents): Removing scaling and text drawing code,
+        and call common CALayer drawing routine.
+        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
+        (WebCore::CACFLayerTreeHost::create): Switch to nullptr.
+        (WebCore::CACFLayerTreeHost::CACFLayerTreeHost): Switch to C++14 initializers.
+        (WebCore::CACFLayerTreeHost::setPage): Added.
+        (WebCore::CACFLayerTreeHost::rootLayer): Update debug info layer if requested by settings.
+        (WebCore::CACFLayerTreeHost::layerTreeDidChange): Ditto.
+        (WebCore::CACFLayerTreeHost::mainFrameTiledBacking): Added.
+        (WebCore::CACFLayerTreeHost::updateDbugInfoLayer): Added.
+        * platform/graphics/ca/win/CACFLayerTreeHost.h:
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        (WebCore::PlatformCALayerWin::drawTextAtPoint): Revised signature for new arguments. Use
+        argument for font size (rather than hard-coded '18'). Adjust font size by passed scale value.
+        * platform/graphics/ca/win/PlatformCALayerWin.h:
+
 2015-09-21  Chris Dumez  <cdumez@apple.com>
 
         [JS Bindings] prototype.constructor should be writable
index aa1d6ccca5895dcba26c4d70007edc4902f615f8..fd64435538c4f29ae2a6264138d1f1f50c5aeffd 100644 (file)
@@ -83,7 +83,7 @@ void PlatformCALayer::drawRepaintIndicator(CGContextRef context, PlatformCALayer
     else
         CGContextSetRGBFillColor(context, 1, 1, 1, 1);
     
-    platformCALayer->drawTextAtPoint(context, indicatorBox.origin.x + 5, indicatorBox.origin.y + 22, text, strlen(text));
+    platformCALayer->drawTextAtPoint(context, indicatorBox.origin.x + 5, indicatorBox.origin.y + 22, CGSizeMake(1, -1), 22, text, strlen(text));
     
     CGContextEndTransparencyLayer(context);
     CGContextRestoreGState(context);
@@ -96,12 +96,12 @@ void PlatformCALayer::flipContext(CGContextRef context, CGFloat height)
 }
 
 // This function is needed to work around a bug in Windows CG <rdar://problem/22703470>
-void PlatformCALayer::drawTextAtPoint(CGContextRef context, CGFloat x, CGFloat y, const char* text, size_t length) const
+void PlatformCALayer::drawTextAtPoint(CGContextRef context, CGFloat x, CGFloat y, CGSize scale, CGFloat fontSize, const char* text, size_t length) const
 {
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1, -1));
-    CGContextSelectFont(context, "Helvetica", 22, kCGEncodingMacRoman);
+    CGContextSetTextMatrix(context, CGAffineTransformMakeScale(scale.width, scale.height));
+    CGContextSelectFont(context, "Helvetica", fontSize, kCGEncodingMacRoman);
     CGContextShowTextAtPoint(context, x, y, text, length);
 #pragma clang diagnostic pop
 }
index 886b13473aca5c46959a566644aadd940220ce47..1e59286bb722a922d4dca1bfed99d2cd65f3d494 100644 (file)
@@ -226,7 +226,7 @@ public:
 
     virtual TiledBacking* tiledBacking() = 0;
 
-    virtual void drawTextAtPoint(CGContextRef, CGFloat x, CGFloat y, const char* text, size_t length) const;
+    virtual void drawTextAtPoint(CGContextRef, CGFloat x, CGFloat y, CGSize scale, CGFloat fontSize, const char* text, size_t length) const;
 
     static void flipContext(CGContextRef, CGFloat height);
 
index 74b902732b07917ed2ae3cd90d8685e1cbca480a..ac94d8d22b6f401d72a259ad51d8d60d0e87193f 100644 (file)
@@ -642,13 +642,9 @@ void TileGrid::drawTileMapContents(CGContextRef context, CGRect layerBounds) con
         String repaintCount = String::number(m_tileRepaintCounts.get(tileLayer));
 
         CGContextSaveGState(context);
-        CGContextSetTextMatrix(context, CGAffineTransformMakeScale(3, -3));
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-        CGContextSelectFont(context, "Helvetica", 58, kCGEncodingMacRoman);
-        CGContextShowTextAtPoint(context, frame.origin.x + 64, frame.origin.y + 192, repaintCount.ascii().data(), repaintCount.length());
-#pragma clang diagnostic pop
+        tileLayer->drawTextAtPoint(context, frame.origin.x + 64, frame.origin.y + 192, CGSizeMake(3, -3), 58,
+            repaintCount.ascii().data(), repaintCount.length());
 
         CGContextRestoreGState(context);
     }
index f5df66e525bbb20c432b86e3de4a601b4a811511..ecbf3b4983b407041df24de826ffd9a77fe373c3 100644 (file)
 #include "CACFLayerTreeHost.h"
 
 #include "CACFLayerTreeHostClient.h"
+#include "DebugPageOverlays.h"
 #include "DefWndProcWindowClass.h"
+#include "FrameView.h"
 #include "LayerChangesFlusher.h"
+#include "MainFrame.h"
 #include "PlatformCALayerWin.h"
+#include "PlatformLayer.h"
+#include "TiledBacking.h"
 #include "WKCACFViewLayerTreeHost.h"
 #include "WebCoreInstanceHandle.h"
 #include <limits.h>
@@ -110,21 +115,14 @@ bool CACFLayerTreeHost::acceleratedCompositingAvailable()
 PassRefPtr<CACFLayerTreeHost> CACFLayerTreeHost::create()
 {
     if (!acceleratedCompositingAvailable())
-        return 0;
+        return nullptr;
     RefPtr<CACFLayerTreeHost> host = WKCACFViewLayerTreeHost::create();
     host->initialize();
     return host.release();
 }
 
 CACFLayerTreeHost::CACFLayerTreeHost()
-    : m_client(0)
-    , m_rootLayer(PlatformCALayerWin::create(PlatformCALayer::LayerTypeRootLayer, 0))
-    , m_window(0)
-    , m_shouldFlushPendingGraphicsLayerChanges(false)
-    , m_isFlushingLayerChanges(false)
-#if !ASSERT_DISABLED
-    , m_state(WindowNotSet)
-#endif
+    : m_rootLayer(PlatformCALayerWin::create(PlatformCALayer::LayerTypeRootLayer, nullptr))
 {
 }
 
@@ -187,6 +185,11 @@ void CACFLayerTreeHost::setWindow(HWND window)
     m_window = window;
 }
 
+void CACFLayerTreeHost::setPage(Page* page)
+{
+    m_page = page;
+}
+
 PlatformCALayer* CACFLayerTreeHost::rootLayer() const
 {
     return m_rootLayer.get();
@@ -203,6 +206,7 @@ void CACFLayerTreeHost::setRootChildLayer(PlatformCALayer* layer)
     m_rootChildLayer = layer;
     if (m_rootChildLayer)
         m_rootLayer->appendSublayer(*m_rootChildLayer);
+    updateDebugInfoLayer(m_page->settings().showTiledScrollingIndicator());
 }
    
 void CACFLayerTreeHost::layerTreeDidChange()
@@ -279,6 +283,8 @@ void CACFLayerTreeHost::flushPendingLayerChangesNow()
     // Calling out to the client could cause our last reference to go away.
     RefPtr<CACFLayerTreeHost> protector(this);
 
+    updateDebugInfoLayer(m_page->settings().showTiledScrollingIndicator());
+
     m_isFlushingLayerChanges = true;
 
     // Flush changes stored up in GraphicsLayers to their underlying PlatformCALayers, if
@@ -330,4 +336,36 @@ String CACFLayerTreeHost::layerTreeAsString() const
     return m_rootLayer->layerTreeAsString();
 }
 
+TiledBacking* CACFLayerTreeHost::mainFrameTiledBacking() const
+{
+    if (!m_page)
+        return nullptr;
+
+    FrameView* frameView = m_page->mainFrame().view();
+    if (!frameView)
+        return nullptr;
+    
+    return frameView->tiledBacking();
+}
+
+void CACFLayerTreeHost::updateDebugInfoLayer(bool showLayer)
+{
+    if (showLayer) {
+        if (!m_debugInfoLayer) {
+            if (TiledBacking* tiledBacking = mainFrameTiledBacking())
+                m_debugInfoLayer = tiledBacking->tiledScrollingIndicatorLayer();
+        }
+
+        if (m_debugInfoLayer) {
+#ifndef NDEBUG
+            m_debugInfoLayer->setName("Debug Info");
+#endif
+            m_rootLayer->appendSublayer(*m_debugInfoLayer);
+        }
+    } else if (m_debugInfoLayer) {
+        m_debugInfoLayer->removeFromSuperlayer();
+        m_debugInfoLayer = nullptr;
+    }
+}
+
 }
index 9f9002330c10045cce9eef9f6385ae49e17b1057..d114b25ab4290020169af47fe5bb094234670cda 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "AbstractCACFLayerTreeHost.h"
 #include "COMPtr.h"
+#include "Page.h"
 #include "Timer.h"
 
 #include <wtf/HashSet.h>
@@ -52,6 +53,7 @@ namespace WebCore {
 
 class CACFLayerTreeHostClient;
 class PlatformCALayer;
+class TiledBacking;
 
 class CACFLayerTreeHost : public RefCounted<CACFLayerTreeHost>, private AbstractCACFLayerTreeHost {
 public:
@@ -64,6 +66,7 @@ public:
 
     void setRootChildLayer(PlatformCALayer*);
     void setWindow(HWND);
+    void setPage(Page*);
     virtual void paint();
     virtual void resize() = 0;
     void flushPendingGraphicsLayerChangesSoon();
@@ -78,6 +81,7 @@ public:
     virtual void flushPendingLayerChangesNow();
 
     String layerTreeAsString() const;
+    void updateDebugInfoLayer(bool);
 
 protected:
     CACFLayerTreeHost();
@@ -86,6 +90,8 @@ protected:
     HWND window() const { return m_window; }
     void notifyAnimationsStarted();
 
+    TiledBacking* mainFrameTiledBacking() const;
+
     // AbstractCACFLayerTreeHost
     virtual PlatformCALayer* rootLayer() const;
 
@@ -105,16 +111,18 @@ private:
     virtual void render(const Vector<CGRect>& dirtyRects = Vector<CGRect>()) = 0;
     virtual void initializeContext(void* userData, PlatformCALayer*) = 0;
 
-    CACFLayerTreeHostClient* m_client;
+    CACFLayerTreeHostClient* m_client { nullptr };
+    Page* m_page { nullptr };
     RefPtr<PlatformCALayer> m_rootLayer;
     RefPtr<PlatformCALayer> m_rootChildLayer;
+    RefPtr<PlatformCALayer> m_debugInfoLayer;
     HashSet<RefPtr<PlatformCALayer> > m_pendingAnimatedLayers;
-    HWND m_window;
-    bool m_shouldFlushPendingGraphicsLayerChanges;
-    bool m_isFlushingLayerChanges;
+    HWND m_window { nullptr };
+    bool m_shouldFlushPendingGraphicsLayerChanges { false };
+    bool m_isFlushingLayerChanges { false };
 
 #if !ASSERT_DISABLED
-    enum { WindowNotSet, WindowSet, WindowCleared } m_state;
+    enum { WindowNotSet, WindowSet, WindowCleared } m_state { WindowNotSet };
 #endif
 };
 
index 8d81a65ab5877b2b588d45fbc037b89f9fd330ed..2c6df1bcbaaa3143371acc0eda29ea5e93b4da31 100644 (file)
@@ -899,7 +899,7 @@ TiledBacking* PlatformCALayerWin::tiledBacking()
     return reinterpret_cast<WebTiledBackingLayerWin*>(intern(this))->tiledBacking();
 }
 
-void PlatformCALayerWin::drawTextAtPoint(CGContextRef context, CGFloat x, CGFloat y, const char* message, size_t length) const
+void PlatformCALayerWin::drawTextAtPoint(CGContextRef context, CGFloat x, CGFloat y, CGSize scale, CGFloat fontSize, const char* message, size_t length) const
 {
     String text(message, length);
 
@@ -910,7 +910,7 @@ void PlatformCALayerWin::drawTextAtPoint(CGContextRef context, CGFloat x, CGFloa
     SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0);
     desc.setOneFamily(metrics.lfSmCaptionFont.lfFaceName);
 
-    desc.setComputedSize(18);
+    desc.setComputedSize(scale.width * fontSize);
 
     FontCascade font = FontCascade(desc, 0, 0);
     font.update(nullptr);
index 574c51180a67ccdd8a7c28c5f4a99193a19193a7..b277c545554691acffb53f25c4d7438097d64996 100644 (file)
@@ -148,7 +148,7 @@ public:
     virtual PlatformCALayer* rootLayer() const override;
     virtual void setNeedsLayout() override;
     virtual void setNeedsCommit() override;
-    virtual void drawTextAtPoint(CGContextRef, CGFloat x, CGFloat y, const char* text, size_t length) const override;
+    virtual void drawTextAtPoint(CGContextRef, CGFloat x, CGFloat y, CGSize scale, CGFloat fontSize, const char* text, size_t length) const override;
 
     virtual String layerTreeAsString() const override;
 
index 86d9b5af3af205f1662916695412e994823e9da3..6dc4c9f2537c817f89ff6b88052aff4140f4fd18 100644 (file)
@@ -1,3 +1,23 @@
+2015-09-21  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Show tiled drawing debug overlay on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=149426
+
+        Reviewed by Dean Jackson.
+
+        * Interfaces/IWebPreferencesPrivate.idl: Add new IWebPreferencesPrivate3 API version
+        so we can add new methods this cycle.
+        * WebPreferenceKeysPrivate.h: Add key for 'WebKitShowTiledScrollingIndicator'
+        * WebPreferences.cpp:
+        (WebPreferences::QueryInterface): Recognize the new IWebPreferencesPrivate3 API.
+        (WebPreferences::showTiledScrollingIndicator): Added.
+        (WebPreferences::setShowTiledScrollingIndicator): Ditto.
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged): Update to recognize 'showTiledScrollingIndicator'.
+        (WebView::setAcceleratedCompositing): Link the CACFLayerTreeHost to the WebCore Page object
+        so that it can see settings information.
+
 2015-09-18  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Use tiled drawing for main background layer
index 2c47954338d6976ef2fab3d85d80a50b321ea3e2..16af2963454a6274cee5e5c093af6ff873829eee 100644 (file)
@@ -168,4 +168,12 @@ interface IWebPreferencesPrivate2 : IWebPreferencesPrivate
     HRESULT setJavaScriptRuntimeFlags([in] unsigned flags);
     HRESULT allowDisplayAndRunningOfInsecureContent([out, retval] BOOL* enabled);
     HRESULT setAllowDisplayAndRunningOfInsecureContent([in] BOOL enabled);
-}
\ No newline at end of file
+}
+
+[uuid(92809BFB-C24F-43AD-863F-601B08CC268D)]
+interface IWebPreferencesPrivate3 : IWebPreferencesPrivate2
+{
+    HRESULT showTiledScrollingIndicator([out, retval] BOOL* enabled);
+    HRESULT setShowTiledScrollingIndicator([in] BOOL enabled);
+}
+
index 30846eda37c9203816e56a0fabb5f77e3075e47b..b2a6ddd077fdfd2d9cfbe7c8734dbc1281434a40 100644 (file)
 #define WebKitEnableInheritURIQueryComponentPreferenceKey "WebKitEnableInheritURIQueryComponent"
 
 #define WebKitAllowDisplayAndRunningOfInsecureContentPreferenceKey "WebKitAllowDisplayAndRunningOfInsecureContent"
+
+#define WebKitShowTiledScrollingIndicatorPreferenceKey "WebKitShowTiledScrollingIndicator"
index 5d182bb7767da01fbbb7deeff56bffcfa5ebf9e6..68b10c96870624670d1ebc59d8d0b5fc1f61fa31 100644 (file)
@@ -532,6 +532,8 @@ HRESULT WebPreferences::QueryInterface(_In_ REFIID riid, _COM_Outptr_ void** ppv
         *ppvObject = static_cast<IWebPreferencesPrivate*>(this);
     else if (IsEqualGUID(riid, IID_IWebPreferencesPrivate2))
         *ppvObject = static_cast<IWebPreferencesPrivate2*>(this);
+    else if (IsEqualGUID(riid, IID_IWebPreferencesPrivate3))
+        *ppvObject = static_cast<IWebPreferencesPrivate3*>(this);
     else if (IsEqualGUID(riid, CLSID_WebPreferences))
         *ppvObject = this;
     else
@@ -1901,3 +1903,17 @@ HRESULT WebPreferences::setAllowDisplayAndRunningOfInsecureContent(BOOL enabled)
     setBoolValue(WebKitAllowDisplayAndRunningOfInsecureContentPreferenceKey, enabled);
     return S_OK;
 }
+
+HRESULT WebPreferences::showTiledScrollingIndicator(_Out_ BOOL* enabled)
+{
+    if (!enabled)
+        return E_POINTER;
+    *enabled = boolValueForKey(WebKitShowTiledScrollingIndicatorPreferenceKey);
+    return S_OK;
+}
+
+HRESULT WebPreferences::setShowTiledScrollingIndicator(BOOL enabled)
+{
+    setBoolValue(WebKitShowTiledScrollingIndicatorPreferenceKey, enabled);
+    return S_OK;
+}
index 00f72a0cc62899a09623a9466e9c866434374e72..6f7f2d67219d079fa29500d72e35639536105792 100644 (file)
@@ -31,7 +31,7 @@
 #include <WebCore/BString.h>
 #include <wtf/RetainPtr.h>
 
-class WebPreferences : public IWebPreferences, public IWebPreferencesPrivate2 {
+class WebPreferences : public IWebPreferences, public IWebPreferencesPrivate3 {
 public:
     static WebPreferences* createInstance();
 protected:
@@ -230,6 +230,10 @@ public:
     virtual HRESULT STDMETHODCALLTYPE allowDisplayAndRunningOfInsecureContent(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setAllowDisplayAndRunningOfInsecureContent(BOOL);
 
+    // IWebPreferencesPrivate3
+    virtual HRESULT STDMETHODCALLTYPE showTiledScrollingIndicator(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setShowTiledScrollingIndicator(BOOL);
+
     // WebPreferences
 
     // This method accesses a different preference key than developerExtrasEnabled.
index b48bdfd41ffff9c9c00bfe7b1dca6fe6b0b932b2..4cd6a66b4aaa1729384be5ea8de09e4203401101 100644 (file)
@@ -4935,7 +4935,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
     settings.setShouldDisplayTextDescriptions(enabled);
 #endif
 
-    COMPtr<IWebPreferencesPrivate2> prefsPrivate(Query, preferences);
+    COMPtr<IWebPreferencesPrivate3> prefsPrivate(Query, preferences);
     if (prefsPrivate) {
         hr = prefsPrivate->localStorageDatabasePath(&str);
         if (FAILED(hr))
@@ -5181,6 +5181,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
         return hr;
     settings.setShowRepaintCounter(enabled);
 
+    hr = prefsPrivate->showTiledScrollingIndicator(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings.setShowTiledScrollingIndicator(!!enabled);
+
 #if ENABLE(WEB_AUDIO)
     settings.setWebAudioEnabled(true);
 #endif // ENABLE(WEB_AUDIO)
@@ -6817,6 +6822,7 @@ void WebView::setAcceleratedCompositing(bool accelerated)
             m_layerTreeHost->setClient(this);
             ASSERT(m_viewWindow);
             m_layerTreeHost->setWindow(m_viewWindow);
+            m_layerTreeHost->setPage(page());
 
             // FIXME: We could perhaps get better performance by never allowing this layer to
             // become tiled (or choosing a higher-than-normal tiling threshold).
index 8f402428a47c6a339c322b830bcfede375096049..5c355b26f0a6085c0a9b2ffbbb6587f7cd9eb9a5 100644 (file)
@@ -5,6 +5,20 @@
         * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
         (-[TestRunnerWKWebView scrollViewDidEndZooming:withView:atScale:]):
 
+2015-09-21  Brent Fulgham  <bfulgham@apple.com>
+
+        [Win] Show tiled drawing debug overlay on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=149426
+
+        Reviewed by Dean Jackson.
+
+        * MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLib.rc: Add new menu option.
+        * MiniBrowser/MiniBrowser.vcxproj/MiniBrowserLibResource.h: Ditto.
+        * MiniBrowser/win/Common.cpp:
+        (::ToggleMenuItem): Recognize new menu item and toggle the 'showTiledScrollingIndicator'
+        flag if needed.
+        * MiniBrowser/win/MiniBrowser.h: Update to use new IWebPreferencesPrivate3 class.
+
 2015-09-21  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Use command-line argument to launch in regular or High DPI mode.
index 93c610b52687cdb22ab6a62933af503ee81f76e6..f701b4c478c268a6acd00c55180f5891638bb915 100644 (file)
@@ -105,6 +105,7 @@ BEGIN
         MENUITEM "Enable WebKit Full Screen",   IDM_WK_FULLSCREEN, CHECKED\r
         MENUITEM SEPARATOR\r
         MENUITEM "Show Compositing Borders",    IDM_COMPOSITING_BORDERS\r
+        MENUITEM "Show Tiled Drawing indicator", IDM_DEBUG_INFO_LAYER\r
         MENUITEM SEPARATOR\r
         MENUITEM "Show Caches Window",          IDM_CACHES\r
         MENUITEM "Show Layer Tree",             IDM_SHOW_LAYER_TREE\r
index 6f58f734b3257427d2abdd24408256ac6bba46b1..425344743f4e15e12ee82dc14c4d5daf651babe9 100644 (file)
@@ -53,6 +53,7 @@
 #define IDM_ZOOM_IN                     172
 #define IDM_ZOOM_OUT                    173
 #define IDM_SHOW_LAYER_TREE             174
+#define IDM_DEBUG_INFO_LAYER            175
 #define IDC_EMPTY_URL_CACHE             1000
 #define IDC_RETURN_FREE_MEMORY          1001
 #define IDC_EMPTY_WEBCORE_CACHE         1002
index 6acd7cee6d6565df90b885c3fb0ac9a97ee55e16..f48e458e2641ce13b68c638f5fde2e032c5d7ede 100644 (file)
@@ -393,6 +393,9 @@ static bool ToggleMenuItem(HWND hWnd, UINT menuID)
         gMiniBrowser->privatePreferences()->setShowDebugBorders(newState);
         gMiniBrowser->privatePreferences()->setShowRepaintCounter(newState);
         break;
+    case IDM_DEBUG_INFO_LAYER:
+        gMiniBrowser->privatePreferences()->setShowTiledScrollingIndicator(newState);
+        break;
     case IDM_INVERT_COLORS:
         gMiniBrowser->privatePreferences()->setShouldInvertColors(newState);
         break;
index fe8f530309daa28e4d58eac72485351ef32602d7..41805cc721deec231f4ae92ab9a2ef054a5cdef3 100644 (file)
@@ -35,7 +35,7 @@ typedef _com_ptr_t<_com_IIID<IWebFrameLoadDelegate, &__uuidof(IWebFrameLoadDeleg
 typedef _com_ptr_t<_com_IIID<IWebHistory, &__uuidof(IWebHistory)>> IWebHistoryPtr;
 typedef _com_ptr_t<_com_IIID<IWebHistoryItem, &__uuidof(IWebHistoryItem)>> IWebHistoryItemPtr;
 typedef _com_ptr_t<_com_IIID<IWebPreferences, &__uuidof(IWebPreferences)>> IWebPreferencesPtr;
-typedef _com_ptr_t<_com_IIID<IWebPreferencesPrivate, &__uuidof(IWebPreferencesPrivate)>> IWebPreferencesPrivatePtr;
+typedef _com_ptr_t<_com_IIID<IWebPreferencesPrivate3, &__uuidof(IWebPreferencesPrivate3)>> IWebPreferencesPrivatePtr;
 typedef _com_ptr_t<_com_IIID<IWebUIDelegate, &__uuidof(IWebUIDelegate)>> IWebUIDelegatePtr;
 typedef _com_ptr_t<_com_IIID<IAccessibilityDelegate, &__uuidof(IAccessibilityDelegate)>> IAccessibilityDelegatePtr;
 typedef _com_ptr_t<_com_IIID<IWebInspector, &__uuidof(IWebInspector)>> IWebInspectorPtr;