All pastes #1792905 Raw Edit

webkit scroll patch

public diff v1 · immutable
#1792905 ·published 2010-02-10 19:16 UTC
rendered paste body
diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.hindex ab11b64..a661eec 100644--- a/WebCore/loader/EmptyClients.h+++ b/WebCore/loader/EmptyClients.h@@ -117,7 +117,7 @@ public:     virtual void updateBackingStore() { }      virtual void repaint(const IntRect&, bool, bool, bool) { }-    virtual bool scroll(const IntSize&, const IntRect&, const IntRect&, bool canBlit) { return canBlit; }+    virtual bool scroll(const ScrollView*, const IntSize&, const IntRect&, const IntRect&, bool canBlit) { return canBlit; }     virtual IntPoint screenToWindow(const IntPoint& p) const { return p; }     virtual IntRect windowToScreen(const IntRect& r) const { return r; }     virtual PlatformPageClient platformPageClient() const { return 0; }diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cppindex 517bea6..650dd1a 100644--- a/WebCore/page/Chrome.cpp+++ b/WebCore/page/Chrome.cpp@@ -72,9 +72,9 @@ void Chrome::repaint(const IntRect& windowRect, bool contentChanged, bool immedi     m_client->repaint(windowRect, contentChanged, immediate, repaintContentOnly); } -bool Chrome::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit)+bool Chrome::scroll(ScrollView* scrollView, const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit) {-    return m_client->scroll(scrollDelta, rectToScroll, clipRect, canBlit);+    return m_client->scroll(scrollView, scrollDelta, rectToScroll, clipRect, canBlit); }  IntPoint Chrome::screenToWindow(const IntPoint& point) constdiff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.hindex 3c36e47..24fe291 100644--- a/WebCore/page/Chrome.h+++ b/WebCore/page/Chrome.h@@ -60,7 +60,7 @@ namespace WebCore {          // HostWindow methods.         virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);-        virtual bool scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit);+        virtual bool scroll(ScrollView*, const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit);         virtual IntPoint screenToWindow(const IntPoint&) const;         virtual IntRect windowToScreen(const IntRect&) const;         virtual PlatformPageClient platformPageClient() const;diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.hindex 0e1a600..17bd6d5 100644--- a/WebCore/page/ChromeClient.h+++ b/WebCore/page/ChromeClient.h@@ -125,7 +125,7 @@ namespace WebCore {          // Methods used by HostWindow.         virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false) = 0;-        virtual bool scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit) = 0;+        virtual bool scroll(const ScrollView* scrollView, const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit) = 0;         virtual IntPoint screenToWindow(const IntPoint&) const = 0;         virtual IntRect windowToScreen(const IntRect&) const = 0;         virtual PlatformPageClient platformPageClient() const = 0;diff --git a/WebCore/platform/HostWindow.h b/WebCore/platform/HostWindow.hindex 8ca5215..d87e89d 100644--- a/WebCore/platform/HostWindow.h+++ b/WebCore/platform/HostWindow.h@@ -39,7 +39,7 @@ public:     // contentChanged boolean indicates whether or not the Web page content actually changed (or if a repaint     // of unchanged content is being requested).     virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false) = 0;-    virtual bool scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit) = 0;+    virtual bool scroll(ScrollView* scrollView, const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit) = 0;      // The paint method just causes a synchronous update of the window to happen for platforms that need it (Windows).     void paint() { repaint(IntRect(), false, true); }diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cppindex 37f14d5..f7abbbd 100644--- a/WebCore/platform/ScrollView.cpp+++ b/WebCore/platform/ScrollView.cpp@@ -516,7 +516,7 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)     bool canBlit = canBlitOnScroll() && !rootPreventsBlitting();      // FIXME: Find a way to blit subframes without blitting overlapping content-    if (!hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect, canBlit)) {+    if (!hostWindow()->scroll(this, -scrollDelta, scrollViewRect, clipRect, canBlit)) {        // We need to go ahead and repaint the entire backing store.  Do it now before moving the        // windowed plugins.        hostWindow()->repaint(updateRect, true, false, true); // Invalidate the backing store and repaint it synchronouslydiff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cppindex 4e316e9..3823ea9 100644--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp@@ -288,9 +288,9 @@ void ChromeClientEfl::contentsSizeChanged(Frame* frame, const IntSize& size) con     ewk_frame_contents_size_changed(kit(frame), size.width(), size.height()); } -bool ChromeClientEfl::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect& clipRect, bool canBlit)+bool ChromeClientEfl::scroll(const ScrollView* scrollView, const IntSize& delta, const IntRect& scrollViewRect, const IntRect& clipRect, bool canBlit) {-    ewk_view_scroll(m_view, delta.width(), delta.height(), scrollViewRect.x(), scrollViewRect.y(), scrollViewRect.width(), scrollViewRect.height(), clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height());+    ewk_view_scroll(m_view, scrollView, delta.width(), delta.height(), scrollViewRect.x(), scrollViewRect.y(), scrollViewRect.width(), scrollViewRect.height(), clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height());     return canBlit; } diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.hindex a5c3dae..2a4fe56 100644--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h@@ -87,7 +87,7 @@ namespace WebCore {          virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);         virtual void contentsSizeChanged(Frame*, const IntSize&) const;-        virtual bool scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit);+        virtual bool scroll(const ScrollView* scrollView, const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect, bool canBlit);         virtual IntPoint screenToWindow(const IntPoint&) const;         virtual IntRect windowToScreen(const IntRect&) const;         virtual PlatformPageClient platformPageClient() const;diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.hindex 78ac859..5662e2d 100644--- a/WebKit/efl/ewk/ewk_private.h+++ b/WebKit/efl/ewk/ewk_private.h@@ -56,7 +56,7 @@ void             ewk_view_load_finished(Evas_Object *o, const Ewk_Frame_Load_Err void             ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error); void             ewk_view_load_progress_changed(Evas_Object *o); void             ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);-void             ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);+void             ewk_view_scroll(Evas_Object *o, const WebCore::ScrollView *scrollView, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch); WebCore::Page   *ewk_view_core_page_get(const Evas_Object *o);  WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Object *frame, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WebCore::String& referrer);diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cppindex 4bc7528..31c3ecd 100644--- a/WebKit/efl/ewk/ewk_view.cpp+++ b/WebKit/efl/ewk/ewk_view.cpp@@ -228,7 +228,7 @@ static inline Eina_Bool _ewk_view_scrolls_resize(Ewk_View_Private_Data *priv, si     return EINA_TRUE; } -static inline void _ewk_view_scroll_add(Ewk_View_Private_Data *priv, Evas_Coord dx, Evas_Coord dy, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)+static inline void _ewk_view_scroll_add(Ewk_View_Private_Data *priv, Evas_Coord dx, Evas_Coord dy, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool main_scroll) {     Ewk_Scroll_Request *r, *r_end;     Evas_Coord x2 = x + w, y2 = y + h;@@ -273,6 +273,7 @@ static inline void _ewk_view_scroll_add(Ewk_View_Private_Data *priv, Evas_Coord     r->y2 = y2;     r->dx = dx;     r->dy = dy;+    r->main_scroll = main_scroll;     DBG("add scroll in region: %d,%d+%dx%d %+03d,%+03d", x, y, w, h, dx, dy);      Eina_Rectangle *pr, *pr_end;@@ -2915,8 +2916,9 @@ void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w,     _ewk_view_smart_changed(sd); } -void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch)+void ewk_view_scroll(Evas_Object *o, const WebCore::ScrollView *scrollView, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch) {+    Eina_Bool main_scroll = EINA_FALSE;     DBG("o=%p, delta: %d,%d, scroll: %d,%d+%dx%d, clip: %d,%d+%dx%d",         o, dx, dy, sx, sy, sw, sh, cx, cy, cw, ch); @@ -2928,7 +2930,11 @@ void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx     EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv);     EINA_SAFETY_ON_TRUE_RETURN(dx == 0 && dy == 0); -    _ewk_view_scroll_add(priv, dx, dy, sx, sy, sw, sh);+    fprintf(stderr, "scrolling: scrollview=%p, main_frame_view=%p\n", scrollView, priv->main_frame->view());+    if (scrollView == priv->main_frame->view())+        main_scroll = EINA_TRUE;++    _ewk_view_scroll_add(priv, dx, dy, sx, sy, sw, sh, main_scroll);     _ewk_view_smart_changed(sd); } diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.hindex de03ea5..922c203 100644--- a/WebKit/efl/ewk/ewk_view.h+++ b/WebKit/efl/ewk/ewk_view.h@@ -162,6 +162,7 @@ struct _Ewk_Scroll_Request {     Evas_Coord dx, dy;     Evas_Coord x, y, w, h, x2, y2;+    Eina_Bool main_scroll; };  /**diff --git a/WebKit/efl/ewk/ewk_view_tiled.cpp b/WebKit/efl/ewk/ewk_view_tiled.cppindex da1283f..983577a 100644--- a/WebKit/efl/ewk/ewk_view_tiled.cpp+++ b/WebKit/efl/ewk/ewk_view_tiled.cpp@@ -85,7 +85,7 @@ static Eina_Bool _ewk_view_tiled_smart_scrolls_process(Ewk_View_Smart_Data *sd)     sr = ewk_view_scroll_requests_get(sd->_priv, &count);     sr_end = sr + count;     for (; sr < sr_end; sr++) {-        if (sr->w == vw && sr->h == vh)+        if (sr->main_scroll)             ewk_tiled_backing_store_scroll_full_offset_add                 (sd->backing_store, sr->dx, sr->dy);         else {