| Differences between
and this patch
- Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp -4 / +28 lines
Lines 67-72 Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp_sec1
67
#include "webkitwebwindowfeaturesprivate.h"
67
#include "webkitwebwindowfeaturesprivate.h"
68
#include <gdk/gdk.h>
68
#include <gdk/gdk.h>
69
#include <gdk/gdkkeysyms.h>
69
#include <gdk/gdkkeysyms.h>
70
#ifdef GDK_WINDOWING_X11
71
#define Font XFont
72
#define Cursor XCursor
73
#define Region XRegion
74
#include <gdk/gdkx.h>
75
#undef Font
76
#undef Cursor
77
#undef Region
78
#undef None
79
#endif
70
#include <glib.h>
80
#include <glib.h>
71
#include <glib/gi18n-lib.h>
81
#include <glib/gi18n-lib.h>
72
#include <gtk/gtk.h>
82
#include <gtk/gtk.h>
Lines 83-92 Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp_sec2
83
#include "HTMLMediaElement.h"
93
#include "HTMLMediaElement.h"
84
#endif
94
#endif
85
95
96
#ifdef GDK_WINDOWING_X11
97
#include "GtkWidgetBackingStoreX11.h"
98
#endif
99
#include "WidgetBackingStoreCairo.h"
100
86
using namespace WebCore;
101
using namespace WebCore;
87
102
88
namespace WebKit {
103
namespace WebKit {
89
104
105
static OwnPtr<WidgetBackingStore> createBackingStore(GtkWidget* widget, const IntSize& size)
106
{
107
#ifdef GDK_WINDOWING_X11
108
    GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
109
    if (GDK_IS_X11_DISPLAY(display))
110
        return WebCore::WidgetBackingStoreGtkX11::create(widget, size);
111
#endif
112
    return WebCore::WidgetBackingStoreCairo::create(widget, size);
113
}
114
90
ChromeClient::ChromeClient(WebKitWebView* webView)
115
ChromeClient::ChromeClient(WebKitWebView* webView)
91
    : m_webView(webView)
116
    : m_webView(webView)
92
    , m_adjustmentWatcher(webView)
117
    , m_adjustmentWatcher(webView)
Lines 455-462 Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp_sec3
455
        || newSize.width() > backingStore->size().width()
480
        || newSize.width() > backingStore->size().width()
456
        || newSize.height() > backingStore->size().height()) {
481
        || newSize.height() > backingStore->size().height()) {
457
482
458
        OwnPtr<WidgetBackingStore> newBackingStore =
483
        OwnPtr<WidgetBackingStore> newBackingStore = createBackingStore(GTK_WIDGET(m_webView), newSize);
459
            WebCore::WidgetBackingStore::create(GTK_WIDGET(m_webView), newSize);
460
        RefPtr<cairo_t> cr = adoptRef(cairo_create(newBackingStore->cairoSurface()));
484
        RefPtr<cairo_t> cr = adoptRef(cairo_create(newBackingStore->cairoSurface()));
461
485
462
        clearEverywhereInBackingStore(m_webView, cr.get());
486
        clearEverywhereInBackingStore(m_webView, cr.get());
Lines 1043-1053 Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp_sec4
1043
1067
1044
    if (turningOnCompositing) {
1068
    if (turningOnCompositing) {
1045
        m_displayTimer.stop();
1069
        m_displayTimer.stop();
1046
        m_webView->priv->backingStore = WebCore::WidgetBackingStore::create(GTK_WIDGET(m_webView), IntSize(1, 1));
1070
        m_webView->priv->backingStore = createBackingStore(GTK_WIDGET(m_webView), IntSize(1, 1));
1047
    }
1071
    }
1048
1072
1049
    if (turningOffCompositing) {
1073
    if (turningOffCompositing) {
1050
        m_webView->priv->backingStore = WebCore::WidgetBackingStore::create(GTK_WIDGET(m_webView), getWebViewRect(m_webView).size());
1074
        m_webView->priv->backingStore = createBackingStore(GTK_WIDGET(m_webView), getWebViewRect(m_webView).size());
1051
        RefPtr<cairo_t> cr = adoptRef(cairo_create(m_webView->priv->backingStore->cairoSurface()));
1075
        RefPtr<cairo_t> cr = adoptRef(cairo_create(m_webView->priv->backingStore->cairoSurface()));
1052
        clearEverywhereInBackingStore(m_webView, cr.get());
1076
        clearEverywhereInBackingStore(m_webView, cr.get());
1053
    }
1077
    }
- Source/WebKit/gtk/ChangeLog +17 lines
Lines 1-3 Source/WebKit/gtk/ChangeLog_sec1
1
2013-05-29  Iago Toral Quiroga  <itoral@igalia.com>
2
3
        Use Cairo implementation of the WidgetBackingStore instead of X11 when running on Wayland
4
        https://bugs.webkit.org/show_bug.cgi?id=116717
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Decide which implementation of WidgetBackingStore to use (X11 or Cairo)
9
        depending on whether we are running on X11 or not. Select Cairo
10
        implementation when not running in X11.
11
12
        * WebCoreSupport/ChromeClientGtk.cpp:
13
        (WebKit::createBackingStore):
14
        (WebKit):
15
        (WebKit::ChromeClient::widgetSizeChanged):
16
        (WebKit::ChromeClient::attachRootGraphicsLayer):
17
1
2013-05-28  Andreas Kling  <akling@apple.com>
18
2013-05-28  Andreas Kling  <akling@apple.com>
2
19
3
        Document::setFocusedNode() should be setFocusedElement().
20
        Document::setFocusedNode() should be setFocusedElement().
- Source/WebCore/ChangeLog +38 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2013-05-29  Iago Toral Quiroga  <itoral@igalia.com>
2
3
        Use Cairo implementation of the WidgetBackingStore instead of X11 when running on Wayland
4
        https://bugs.webkit.org/show_bug.cgi?id=116717
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Refactored WidgetBackingStore to be an abstract base class and make
9
        GtkWidgetBackingStoreX11 and WidgetBackingStoreCairo inherit from it.
10
        GtkWidgetBackingStoreX11 renamed to WidgetBackingStoreGtkX11.
11
12
        * GNUmakefile.list.am:
13
        * platform/cairo/WidgetBackingStore.h:
14
        (WebCore):
15
        (WidgetBackingStore):
16
        (WebCore::WidgetBackingStore::WidgetBackingStore):
17
        (WebCore::WidgetBackingStore::~WidgetBackingStore):
18
        * platform/cairo/WidgetBackingStoreCairo.cpp:
19
        (WebCore::WidgetBackingStoreCairo::create):
20
        (WebCore):
21
        (WebCore::WidgetBackingStoreCairo::WidgetBackingStoreCairo):
22
        (WebCore::WidgetBackingStoreCairo::~WidgetBackingStoreCairo):
23
        (WebCore::WidgetBackingStoreCairo::cairoSurface):
24
        (WebCore::WidgetBackingStoreCairo::scroll):
25
        * platform/cairo/WidgetBackingStoreCairo.h: Added.
26
        (WebCore):
27
        (WidgetBackingStoreCairo):
28
        * platform/gtk/GtkWidgetBackingStoreX11.cpp:
29
        (WebCore::WidgetBackingStoreGtkX11::create):
30
        (WebCore):
31
        (WebCore::WidgetBackingStoreGtkX11::WidgetBackingStoreGtkX11):
32
        (WebCore::WidgetBackingStoreGtkX11::~WidgetBackingStoreGtkX11):
33
        (WebCore::WidgetBackingStoreGtkX11::cairoSurface):
34
        (WebCore::WidgetBackingStoreGtkX11::scroll):
35
        * platform/gtk/GtkWidgetBackingStoreX11.h: Added.
36
        (WebCore):
37
        (WidgetBackingStoreGtkX11):
38
1
2013-05-29  Peter Gal  <galpeter@inf.u-szeged.hu>
39
2013-05-29  Peter Gal  <galpeter@inf.u-szeged.hu>
2
40
3
        [Qt] Missing files from build after r150853
41
        [Qt] Missing files from build after r150853
- Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp -56 / +28 lines
Lines 17-96 Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp_sec1
17
 */
17
 */
18
18
19
#include "config.h"
19
#include "config.h"
20
#include "WidgetBackingStore.h"
20
#include "GtkWidgetBackingStoreX11.h"
21
21
22
#include "GtkVersioning.h"
22
#include "GtkVersioning.h"
23
#include "RefPtrCairo.h"
23
#include "RefPtrCairo.h"
24
#include <X11/Xlib.h>
25
#include <cairo-xlib.h>
24
#include <cairo-xlib.h>
26
#include <cairo.h>
25
#include <cairo.h>
27
#include <gdk/gdkx.h>
26
#include <gdk/gdkx.h>
28
27
29
namespace WebCore {
28
namespace WebCore {
30
29
31
class WidgetBackingStorePrivate {
30
PassOwnPtr<WidgetBackingStore> WidgetBackingStoreGtkX11::create(GtkWidget* widget, const IntSize& size)
32
    WTF_MAKE_NONCOPYABLE(WidgetBackingStorePrivate);
33
    WTF_MAKE_FAST_ALLOCATED;
34
35
public:
36
    Display* m_display;
37
    Pixmap m_pixmap;
38
    GC m_gc;
39
    RefPtr<cairo_surface_t> m_surface;
40
41
    static PassOwnPtr<WidgetBackingStorePrivate> create(GtkWidget* widget, const IntSize& size)
42
    {
43
        return adoptPtr(new WidgetBackingStorePrivate(widget, size));
44
    }
45
46
    ~WidgetBackingStorePrivate()
47
    {
48
        XFreePixmap(m_display, m_pixmap);
49
        XFreeGC(m_display, m_gc);
50
    }
51
52
private:
53
    // We keep two copies of the surface here, which will double the memory usage, but increase
54
    // scrolling performance since we do not have to keep reallocating a memory region during
55
    // quick scrolling requests.
56
    WidgetBackingStorePrivate(GtkWidget* widget, const IntSize& size)
57
    {
58
        GdkVisual* visual = gtk_widget_get_visual(widget);
59
        GdkScreen* screen = gdk_visual_get_screen(visual);
60
        m_display = GDK_SCREEN_XDISPLAY(screen);
61
        m_pixmap = XCreatePixmap(m_display,
62
                                 GDK_WINDOW_XID(gdk_screen_get_root_window(screen)),
63
                                 size.width(), size.height(),
64
                                 gdk_visual_get_depth(visual));
65
        m_gc = XCreateGC(m_display, m_pixmap, 0, 0);
66
67
        m_surface = adoptRef(cairo_xlib_surface_create(m_display, m_pixmap,
68
                                                       GDK_VISUAL_XVISUAL(visual),
69
                                                       size.width(), size.height()));
70
    }
71
};
72
73
PassOwnPtr<WidgetBackingStore> WidgetBackingStore::create(GtkWidget* widget, const IntSize& size)
74
{
31
{
75
    return adoptPtr(new WidgetBackingStore(widget, size));
32
    return adoptPtr(new WidgetBackingStoreGtkX11(widget, size));
76
}
33
}
77
34
78
WidgetBackingStore::WidgetBackingStore(GtkWidget* widget, const IntSize& size)
35
// We keep two copies of the surface here, which will double the memory usage, but increase
79
    : m_private(WidgetBackingStorePrivate::create(widget, size))
36
// scrolling performance since we do not have to keep reallocating a memory region during
80
    , m_size(size)
37
// quick scrolling requests.
38
WidgetBackingStoreGtkX11::WidgetBackingStoreGtkX11(GtkWidget* widget, const IntSize& size)
39
    : WidgetBackingStore(size)
81
{
40
{
41
    GdkVisual* visual = gtk_widget_get_visual(widget);
42
    GdkScreen* screen = gdk_visual_get_screen(visual);
43
    m_display = GDK_SCREEN_XDISPLAY(screen);
44
    m_pixmap = XCreatePixmap(m_display,
45
        GDK_WINDOW_XID(gdk_screen_get_root_window(screen)),
46
        size.width(), size.height(),
47
        gdk_visual_get_depth(visual));
48
    m_gc = XCreateGC(m_display, m_pixmap, 0, 0);
49
50
    m_surface = adoptRef(cairo_xlib_surface_create(m_display, m_pixmap,
51
        GDK_VISUAL_XVISUAL(visual), size.width(), size.height()));
82
}
52
}
83
53
84
WidgetBackingStore::~WidgetBackingStore()
54
WidgetBackingStoreGtkX11::~WidgetBackingStoreGtkX11()
85
{
55
{
56
    XFreePixmap(m_display, m_pixmap);
57
    XFreeGC(m_display, m_gc);
86
}
58
}
87
59
88
cairo_surface_t* WidgetBackingStore::cairoSurface()
60
cairo_surface_t* WidgetBackingStoreGtkX11::cairoSurface()
89
{
61
{
90
    return m_private->m_surface.get();
62
    return m_surface.get();
91
}
63
}
92
64
93
void WidgetBackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
65
void WidgetBackingStoreGtkX11::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
94
{
66
{
95
    IntRect targetRect(scrollRect);
67
    IntRect targetRect(scrollRect);
96
    targetRect.move(scrollOffset);
68
    targetRect.move(scrollOffset);
Lines 98-109 Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp_sec2
98
    if (targetRect.isEmpty())
70
    if (targetRect.isEmpty())
99
        return;
71
        return;
100
72
101
    cairo_surface_flush(m_private->m_surface.get());
73
    cairo_surface_flush(m_surface.get());
102
    XCopyArea(m_private->m_display, m_private->m_pixmap, m_private->m_pixmap, m_private->m_gc, 
74
    XCopyArea(m_display, m_pixmap, m_pixmap, m_gc, 
103
              targetRect.x() - scrollOffset.width(), targetRect.y() - scrollOffset.height(),
75
              targetRect.x() - scrollOffset.width(), targetRect.y() - scrollOffset.height(),
104
              targetRect.width(), targetRect.height(),
76
              targetRect.width(), targetRect.height(),
105
              targetRect.x(), targetRect.y());
77
              targetRect.x(), targetRect.y());
106
    cairo_surface_mark_dirty_rectangle(m_private->m_surface.get(),
78
    cairo_surface_mark_dirty_rectangle(m_surface.get(),
107
                                       targetRect.x(), targetRect.y(),
79
                                       targetRect.x(), targetRect.y(),
108
                                       targetRect.width(), targetRect.height());
80
                                       targetRect.width(), targetRect.height());
109
}
81
}
- Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.h +46 lines
Line 0 Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.h_sec1
1
/*
2
 * Copyright (C) 2013, Igalia S.L.
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Lesser General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Lesser General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Lesser General Public
15
 *  License along with this library; if not, write to the Free Software
16
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
 */
18
19
#ifndef GtkWidgetBackingStoreX11_h
20
#define GtkWidgetBackingStoreX11_h
21
22
#include "WidgetBackingStore.h"
23
24
#include <X11/Xlib.h>
25
26
namespace WebCore {
27
28
class WidgetBackingStoreGtkX11 : public WidgetBackingStore {
29
30
public:
31
    static PassOwnPtr<WidgetBackingStore> create(GtkWidget*, const IntSize&);
32
    WidgetBackingStoreGtkX11(GtkWidget*, const IntSize&);
33
    ~WidgetBackingStoreGtkX11();
34
    cairo_surface_t* cairoSurface();
35
    void scroll(const IntRect& scrollRect, const IntSize& scrollOffset);
36
37
private:
38
    Display* m_display;
39
    Pixmap m_pixmap;
40
    GC m_gc;
41
    RefPtr<cairo_surface_t> m_surface;
42
};
43
44
} // namespace WebCore
45
46
#endif // GtkWidgetBackingStoreX11_h
- Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h +42 lines
Line 0 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h_sec1
1
/*
2
 * Copyright (C) 2013, Igalia S.L.
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Lesser General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Lesser General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Lesser General Public
15
 *  License along with this library; if not, write to the Free Software
16
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
 */
18
19
#ifndef WidgetBackingStoreCairo_h
20
#define WidgetBackingStoreCairo_h
21
22
#include "WidgetBackingStore.h"
23
24
namespace WebCore {
25
26
class WidgetBackingStoreCairo : public WidgetBackingStore {
27
28
public:
29
    static PassOwnPtr<WidgetBackingStore> create(PlatformWidget, const IntSize&);
30
    WidgetBackingStoreCairo(PlatformWidget, const IntSize&);
31
    ~WidgetBackingStoreCairo();
32
    cairo_surface_t* cairoSurface();
33
    void scroll(const IntRect&, const IntSize&);
34
35
private:
36
    RefPtr<cairo_surface_t> m_surface;
37
    RefPtr<cairo_surface_t> m_scrollSurface;
38
};
39
40
} // namespace WebCore
41
42
#endif // WidgetBackingStoreCairo_h
- Source/WebCore/platform/cairo/WidgetBackingStore.h -10 / +4 lines
Lines 35-42 Source/WebCore/platform/cairo/WidgetBackingStore.h_sec1
35
35
36
namespace WebCore {
36
namespace WebCore {
37
37
38
class WidgetBackingStorePrivate;
39
40
#if PLATFORM(GTK)
38
#if PLATFORM(GTK)
41
typedef GtkWidget* PlatformWidget;
39
typedef GtkWidget* PlatformWidget;
42
#elif PLATFORM(EFL)
40
#elif PLATFORM(EFL)
Lines 48-64 Source/WebCore/platform/cairo/WidgetBackingStore.h_sec2
48
    WTF_MAKE_FAST_ALLOCATED;
46
    WTF_MAKE_FAST_ALLOCATED;
49
47
50
public:
48
public:
51
    static PassOwnPtr<WidgetBackingStore> create(PlatformWidget, const IntSize&);
49
    virtual cairo_surface_t* cairoSurface() = 0;
52
50
    virtual void scroll(const IntRect& scrollRect, const IntSize& scrollOffset) = 0;
53
    ~WidgetBackingStore();
54
    cairo_surface_t* cairoSurface();
55
    void scroll(const IntRect& scrollRect, const IntSize& scrollOffset);
56
    const IntSize& size() { return m_size; }
51
    const IntSize& size() { return m_size; }
52
    WidgetBackingStore(const IntSize& size) : m_size(size) { }
53
    virtual ~WidgetBackingStore() { }
57
54
58
private:
55
private:
59
    WidgetBackingStore(PlatformWidget, const IntSize&);
60
61
    OwnPtr<WidgetBackingStorePrivate> m_private;
62
    IntSize m_size;
56
    IntSize m_size;
63
};
57
};
64
58
- Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp -40 / +17 lines
Lines 18-33 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp_sec1
18
 */
18
 */
19
19
20
#include "config.h"
20
#include "config.h"
21
#include "WidgetBackingStore.h"
21
#include "WidgetBackingStoreCairo.h"
22
22
23
#include "CairoUtilities.h"
23
#include "CairoUtilities.h"
24
#include "RefPtrCairo.h"
24
#include "RefPtrCairo.h"
25
#include <cairo.h>
25
#include <cairo.h>
26
26
27
#if PLATFORM(GTK)
28
#include "GtkVersioning.h"
29
#endif
30
31
namespace WebCore {
27
namespace WebCore {
32
28
33
static PassRefPtr<cairo_surface_t> createSurfaceForBackingStore(PlatformWidget widget, const IntSize& size)
29
static PassRefPtr<cairo_surface_t> createSurfaceForBackingStore(PlatformWidget widget, const IntSize& size)
Lines 40-90 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp_sec2
40
#endif
36
#endif
41
}
37
}
42
38
43
class WidgetBackingStorePrivate {
39
PassOwnPtr<WidgetBackingStore> WidgetBackingStoreCairo::create(PlatformWidget widget, const IntSize& size)
44
    WTF_MAKE_NONCOPYABLE(WidgetBackingStorePrivate);
45
    WTF_MAKE_FAST_ALLOCATED;
46
47
public:
48
    RefPtr<cairo_surface_t> m_surface;
49
    RefPtr<cairo_surface_t> m_scrollSurface;
50
51
    static PassOwnPtr<WidgetBackingStorePrivate> create(PlatformWidget widget, const IntSize& size)
52
    {
53
        return adoptPtr(new WidgetBackingStorePrivate(widget, size));
54
    }
55
56
private:
57
    // We keep two copies of the surface here, which will double the memory usage, but increase
58
    // scrolling performance since we do not have to keep reallocating a memory region during
59
    // quick scrolling requests.
60
    WidgetBackingStorePrivate(PlatformWidget widget, const IntSize& size)
61
        : m_surface(createSurfaceForBackingStore(widget, size))
62
        , m_scrollSurface(createSurfaceForBackingStore(widget, size))
63
    {
64
    }
65
};
66
67
PassOwnPtr<WidgetBackingStore> WidgetBackingStore::create(PlatformWidget widget, const IntSize& size)
68
{
40
{
69
    return adoptPtr(new WidgetBackingStore(widget, size));
41
    return adoptPtr(new WidgetBackingStoreCairo(widget, size));
70
}
42
}
71
43
72
WidgetBackingStore::WidgetBackingStore(PlatformWidget widget, const IntSize& size)
44
// We keep two copies of the surface here, which will double the memory usage, but increase
73
    : m_private(WidgetBackingStorePrivate::create(widget, size))
45
// scrolling performance since we do not have to keep reallocating a memory region during
74
    , m_size(size)
46
// quick scrolling requests.
47
WidgetBackingStoreCairo::WidgetBackingStoreCairo(PlatformWidget widget, const IntSize& size)
48
    : WidgetBackingStore(size)
49
    , m_surface(createSurfaceForBackingStore(widget, size))
50
    , m_scrollSurface(createSurfaceForBackingStore(widget, size))
51
75
{
52
{
76
}
53
}
77
54
78
WidgetBackingStore::~WidgetBackingStore()
55
WidgetBackingStoreCairo::~WidgetBackingStoreCairo()
79
{
56
{
80
}
57
}
81
58
82
cairo_surface_t* WidgetBackingStore::cairoSurface()
59
cairo_surface_t* WidgetBackingStoreCairo::cairoSurface()
83
{
60
{
84
    return m_private->m_surface.get();
61
    return m_surface.get();
85
}
62
}
86
63
87
void WidgetBackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
64
void WidgetBackingStoreCairo::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
88
{
65
{
89
    IntRect targetRect(scrollRect);
66
    IntRect targetRect(scrollRect);
90
    targetRect.move(scrollOffset);
67
    targetRect.move(scrollOffset);
Lines 93-101 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp_sec3
93
    if (targetRect.isEmpty())
70
    if (targetRect.isEmpty())
94
        return;
71
        return;
95
72
96
    copyRectFromOneSurfaceToAnother(m_private->m_surface.get(), m_private->m_scrollSurface.get(),
73
    copyRectFromOneSurfaceToAnother(m_surface.get(), m_scrollSurface.get(),
97
                                    scrollOffset, targetRect);
74
                                    scrollOffset, targetRect);
98
    copyRectFromOneSurfaceToAnother(m_private->m_scrollSurface.get(), m_private->m_surface.get(),
75
    copyRectFromOneSurfaceToAnother(m_scrollSurface.get(), m_surface.get(),
99
                                    IntSize(), targetRect);
76
                                    IntSize(), targetRect);
100
}
77
}
101
78
- Source/WebCore/GNUmakefile.list.am -1 / +5 lines
Lines 6271-6277 Source/WebCore/GNUmakefile.list.am_sec1
6271
	Source/WebCore/plugins/gtk/PluginViewGtk.cpp \
6271
	Source/WebCore/plugins/gtk/PluginViewGtk.cpp \
6272
	Source/WebCore/plugins/gtk/xembed.h
6272
	Source/WebCore/plugins/gtk/xembed.h
6273
platformgtk_sources += \
6273
platformgtk_sources += \
6274
	Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp
6274
	Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.h \
6275
	Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp \
6276
	Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h \
6277
	Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp
6275
if USE_OPENGL
6278
if USE_OPENGL
6276
webcoregtk_sources += \
6279
webcoregtk_sources += \
6277
	Source/WebCore/platform/graphics/cairo/GLContext.cpp \
6280
	Source/WebCore/platform/graphics/cairo/GLContext.cpp \
Lines 6312-6317 Source/WebCore/GNUmakefile.list.am_sec2
6312
	Source/WebCore/plugins/win/PluginPackageWin.cpp
6315
	Source/WebCore/plugins/win/PluginPackageWin.cpp
6313
webcoregtk_sources += \
6316
webcoregtk_sources += \
6314
	Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp \
6317
	Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp \
6318
	Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h \
6315
	Source/WebCore/plugins/win/PluginViewWin.cpp
6319
	Source/WebCore/plugins/win/PluginViewWin.cpp
6316
else
6320
else
6317
webcore_sources += \
6321
webcore_sources += \
- Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp -2 / +19 lines
Lines 27-36 Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp_sec1
27
#include "config.h"
27
#include "config.h"
28
#include "BackingStore.h"
28
#include "BackingStore.h"
29
29
30
#if PLATFORM(GTK) && defined(GDK_WINDOWING_X11)
31
#include <WebCore/GtkWidgetBackingStoreX11.h>
32
#include <gdk/gdkx.h>
33
#endif
30
#include "ShareableBitmap.h"
34
#include "ShareableBitmap.h"
31
#include "UpdateInfo.h"
35
#include "UpdateInfo.h"
32
#include "WebPageProxy.h"
36
#include "WebPageProxy.h"
33
#include <WebCore/GraphicsContext.h>
37
#include <WebCore/GraphicsContext.h>
38
#include <WebCore/WidgetBackingStoreCairo.h>
34
#include <cairo.h>
39
#include <cairo.h>
35
40
36
#if PLATFORM(EFL)
41
#if PLATFORM(EFL)
Lines 41-46 Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp_sec2
41
46
42
namespace WebKit {
47
namespace WebKit {
43
48
49
#if PLATFORM(GTK)
50
static OwnPtr<WidgetBackingStore> createBackingStore(GtkWidget* widget, const IntSize& size)
51
{
52
#ifdef GDK_WINDOWING_X11
53
    GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
54
    if (GDK_IS_X11_DISPLAY(display))
55
        return WebCore::WidgetBackingStoreGtkX11::create(widget, size);
56
#endif
57
    return WebCore::WidgetBackingStoreCairo::create(widget, size);
58
}
59
#endif
60
44
void BackingStore::paint(cairo_t* context, const IntRect& rect)
61
void BackingStore::paint(cairo_t* context, const IntRect& rect)
45
{
62
{
46
    ASSERT(m_backingStore);
63
    ASSERT(m_backingStore);
Lines 55-63 Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp_sec3
55
{
72
{
56
    if (!m_backingStore)
73
    if (!m_backingStore)
57
#if PLATFORM(EFL)
74
#if PLATFORM(EFL)
58
        m_backingStore = WidgetBackingStore::create(EwkView::toEvasObject(toAPI(m_webPageProxy)), size());
75
        m_backingStore = WidgetBackingStoreCairo::create(EwkView::toEvasObject(toAPI(m_webPageProxy)), size());
59
#else
76
#else
60
        m_backingStore = WidgetBackingStore::create(m_webPageProxy->viewWidget(), size());
77
        m_backingStore = createBackingStore(m_webPageProxy->viewWidget(), size());
61
#endif
78
#endif
62
79
63
    scroll(updateInfo.scrollRect, updateInfo.scrollOffset);
80
    scroll(updateInfo.scrollRect, updateInfo.scrollOffset);
- Source/WebKit2/ChangeLog +16 lines
Lines 1-3 Source/WebKit2/ChangeLog_sec1
1
2013-05-29  Iago Toral Quiroga  <itoral@igalia.com>
2
3
        Use Cairo implementation of the WidgetBackingStore instead of X11 when running on Wayland
4
        https://bugs.webkit.org/show_bug.cgi?id=116717
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Decide which implementation of WidgetBackingStore to use (X11 or Cairo)
9
        depending on whether we are running on X11 or not. Select Cairo
10
        implementation when not running in X11.
11
12
        * UIProcess/cairo/BackingStoreCairo.cpp:
13
        (WebKit):
14
        (WebKit::createBackingStore):
15
        (WebKit::BackingStore::incorporateUpdate):
16
1
2013-05-29  Seokju Kwon  <seokju.kwon@gmail.com>
17
2013-05-29  Seokju Kwon  <seokju.kwon@gmail.com>
2
18
3
        [GTK] Clean up WebKit2 GNUmakefile.am
19
        [GTK] Clean up WebKit2 GNUmakefile.am

Return to Bug 116717