[BlackBerry]Web Inspector highlight is slow
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2012 16:23:42 +0000 (16:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jun 2012 16:23:42 +0000 (16:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=88331

Patch by Konrad Piascik <kpiascik@rim.com> on 2012-06-05
Reviewed by Rob Buis.

Highlight is slow on large pages because of constant repaint calls.
Change to use the accelerated layer highlight all the time.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::renderContents):
* WebCoreSupport/InspectorClientBlackBerry.cpp:
(WebCore::InspectorClientBlackBerry::highlight):
(WebCore::InspectorClientBlackBerry::hideHighlight):
* WebCoreSupport/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::clear):
(WebCore::InspectorOverlay::update):

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

Source/WebKit/blackberry/Api/BackingStore.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp
Source/WebKit/blackberry/WebCoreSupport/InspectorOverlay.cpp

index ebae02d..ddeee9f 100644 (file)
@@ -2448,15 +2448,6 @@ void BackingStorePrivate::renderContents(BlackBerry::Platform::Graphics::Buffer*
         // Let WebCore render the page contents into the drawing surface.
         m_client->frame()->view()->paintContents(&graphicsContext, untransformedContentsRect);
 
-#if ENABLE(INSPECTOR)
-        if (m_webPage->d->m_page->inspectorController()->enabled()) {
-            WebCore::IntPoint scrollPosition = m_client->frame()->view()->scrollPosition();
-            graphicsContext.translate(scrollPosition.x(), scrollPosition.y());
-            if (m_webPage->d->m_inspectorOverlay)
-                m_webPage->d->m_inspectorOverlay->paintWebFrame(graphicsContext);
-        }
-#endif
-
         graphicsContext.restore();
     }
 
index 7bb04f8..e7669db 100644 (file)
@@ -1,3 +1,22 @@
+2012-06-05  Konrad Piascik  <kpiascik@rim.com>
+
+        [BlackBerry]Web Inspector highlight is slow
+        https://bugs.webkit.org/show_bug.cgi?id=88331
+
+        Reviewed by Rob Buis.
+
+        Highlight is slow on large pages because of constant repaint calls.
+        Change to use the accelerated layer highlight all the time.
+
+        * Api/BackingStore.cpp:
+        (BlackBerry::WebKit::BackingStorePrivate::renderContents):
+        * WebCoreSupport/InspectorClientBlackBerry.cpp:
+        (WebCore::InspectorClientBlackBerry::highlight):
+        (WebCore::InspectorClientBlackBerry::hideHighlight):
+        * WebCoreSupport/InspectorOverlay.cpp:
+        (WebCore::InspectorOverlay::clear):
+        (WebCore::InspectorOverlay::update):
+
 2012-06-04  Andrew Lo  <anlo@rim.com>
 
         [BlackBerry] Split AnimationFrameRateController into its own file
index 1df7764..dbb5f08 100644 (file)
@@ -46,15 +46,11 @@ void InspectorClientBlackBerry::inspectorDestroyed()
 void InspectorClientBlackBerry::highlight()
 {
     m_webPagePrivate->setInspectorOverlayClient(this);
-    if (!m_webPagePrivate->isAcceleratedCompositingActive())
-        m_webPagePrivate->mainFrame()->document()->documentElement()->renderer()->repaint(true);
 }
 
 void InspectorClientBlackBerry::hideHighlight()
 {
     m_webPagePrivate->setInspectorOverlayClient(0);
-    if (!m_webPagePrivate->isAcceleratedCompositingActive())
-        m_webPagePrivate->mainFrame()->document()->documentElement()->renderer()->repaint(true);
 }
 
 void InspectorClientBlackBerry::openInspectorFrontend(InspectorController*)
index c568f13..fa48cd6 100644 (file)
@@ -77,8 +77,6 @@ InspectorOverlay::~InspectorOverlay() { }
 
 void InspectorOverlay::clear()
 {
-    invalidateWebFrame();
-
 #if USE(ACCELERATED_COMPOSITING)
     if (m_overlay) {
         m_overlay->removeFromParent();
@@ -89,12 +87,10 @@ void InspectorOverlay::clear()
 
 void InspectorOverlay::update()
 {
-    invalidateWebFrame();
-
 #if USE(ACCELERATED_COMPOSITING)
     if (!m_overlay) {
         m_overlay = adoptPtr(new BlackBerry::WebKit::WebOverlay(this));
-        const IntSize size = m_webPage->viewportSize();
+        const IntSize size = m_webPage->contentsSize();
         m_overlay->setSize(FloatSize(size.width(), size.height()));
         m_webPage->m_webPage->addOverlay(m_overlay.get());
     }
@@ -105,24 +101,4 @@ void InspectorOverlay::update()
 #endif
 }
 
-void InspectorOverlay::paintWebFrame(GraphicsContext& gc)
-{
-    if (!m_webPage->isAcceleratedCompositingActive())
-        m_client->paintInspectorOverlay(gc);
-}
-
-void InspectorOverlay::invalidateWebFrame()
-{
-    // InspectorOverlayClient does the actual painting of the overlay.
-    // Here we just make sure to invalidate.
-    if (!m_webPage->isAcceleratedCompositingActive()) {
-        // FIXME: able to invalidate a smaller rect.
-        // FIXME: Is it important to just invalidate a smaller rect given that
-        // this is not on a critical codepath? In order to do so, we'd
-        // have to take scrolling into account.
-        const IntSize size = m_webPage->viewportSize();
-        IntRect damagedRect(0, 0, size.width(), size.height());
-    }
-}
-
 }