Source/WebCore/PlatformEfl.cmake

4040 page/efl/DragControllerEfl.cpp
4141 page/efl/EventHandlerEfl.cpp
4242
 43 platform/cairo/WidgetBackingStore.cpp
4344 platform/cairo/WidgetBackingStoreCairo.cpp
4445
4546 platform/Cursor.cpp
150575

Source/WebCore/GNUmakefile.list.am

61746174 Source/WebCore/page/gtk/DragControllerGtk.cpp \
61756175 Source/WebCore/page/gtk/EventHandlerGtk.cpp \
61766176 Source/WebCore/platform/cairo/WidgetBackingStore.h \
 6177 Source/WebCore/platform/cairo/WidgetBackingStore.cpp \
61776178 Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp \
61786179 Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h \
61796180 Source/WebCore/platform/graphics/freetype/FontPlatformData.h \

62936294 Source/WebCore/plugins/gtk/PluginViewGtk.cpp \
62946295 Source/WebCore/plugins/gtk/xembed.h
62956296platformgtk_sources += \
6296  Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp
 6297 Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.h \
 6298 Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp \
 6299 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h \
 6300 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp
62976301if USE_OPENGL
62986302webcoregtk_sources += \
62996303 Source/WebCore/platform/graphics/cairo/GLContext.cpp \

63346338 Source/WebCore/plugins/win/PluginPackageWin.cpp
63356339webcoregtk_sources += \
63366340 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp \
 6341 Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h \
63376342 Source/WebCore/plugins/win/PluginViewWin.cpp
63386343else
63396344webcore_sources += \
150575

Source/WebCore/ChangeLog

 12013-05-27 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. Make
 9 GtkWidgetBackingStoreX11 and WidgetBackingStoreCairo inherit from it.
 10 Make WidgetBackingStore::create decide which implementation to use
 11 at run-time. For GTK it will use Cairo when running on Wayland and X11
 12 otherwise. For other platforms will use Cairo in all cases.
 13
 14 * GNUmakefile.list.am:
 15 * PlatformEfl.cmake:
 16 * PlatformGTK.cmake:
 17 * platform/cairo/WidgetBackingStore.cpp: Added.
 18 (WebCore):
 19 (WebCore::WidgetBackingStore::create):
 20 * platform/cairo/WidgetBackingStore.h:
 21 (WebCore):
 22 (WidgetBackingStore):
 23 (WebCore::WidgetBackingStore::WidgetBackingStore):
 24 (WebCore::WidgetBackingStore::~WidgetBackingStore):
 25 * platform/cairo/WidgetBackingStoreCairo.cpp:
 26 (WebCore::WidgetBackingStoreCairo::create):
 27 (WebCore::WidgetBackingStoreCairo::WidgetBackingStoreCairo):
 28 (WebCore::WidgetBackingStoreCairo::~WidgetBackingStoreCairo):
 29 (WebCore::WidgetBackingStoreCairo::cairoSurface):
 30 (WebCore::WidgetBackingStoreCairo::scroll):
 31 * platform/cairo/WidgetBackingStoreCairo.h: Added.
 32 (WebCore):
 33 (WidgetBackingStoreCairo):
 34 * platform/gtk/GtkWidgetBackingStoreX11.cpp:
 35 (WebCore::GtkWidgetBackingStoreX11::create):
 36 (WebCore::GtkWidgetBackingStoreX11::GtkWidgetBackingStoreX11):
 37 (WebCore::GtkWidgetBackingStoreX11::~GtkWidgetBackingStoreX11):
 38 (WebCore::GtkWidgetBackingStoreX11::cairoSurface):
 39 (WebCore::GtkWidgetBackingStoreX11::scroll):
 40 * platform/gtk/GtkWidgetBackingStoreX11.h: Added.
 41 (WebCore):
 42 (GtkWidgetBackingStoreX11):
 43
1442013-05-27 Charles Wei <charles.wei@torchmobile.com.cn>
245
346 Remove redundant CachedRawResource::loader()
150740

Source/WebCore/PlatformGTK.cmake

4545 page/gtk/DragControllerGtk.cpp
4646 page/gtk/EventHandlerGtk.cpp
4747
 48 platform/cairo/WidgetBackingStore.cpp
4849 platform/cairo/WidgetBackingStoreCairo.cpp
4950
5051 platform/Cursor.cpp
150575

Source/WebCore/platform/cairo/WidgetBackingStore.cpp

 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#include "config.h"
 20#include "WidgetBackingStore.h"
 21
 22#if PLATFORM(GTK)
 23#include "GtkWidgetBackingStoreX11.h"
 24#endif
 25#include "WidgetBackingStoreCairo.h"
 26
 27#if PLATFORM(GTK)
 28#include <gdk/gdk.h>
 29#ifdef GDK_WINDOWING_X11
 30#include <gdk/gdkx.h>
 31#endif
 32#endif
 33
 34namespace WebCore {
 35
 36PassOwnPtr<WidgetBackingStore> WidgetBackingStore::create(PlatformWidget widget, const IntSize& size)
 37{
 38#if PLATFORM(GTK) && !defined(GTK_API_VERSION_2)
 39 GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
 40 if (GDK_IS_X11_DISPLAY(display))
 41 return WebCore::GtkWidgetBackingStoreX11::create(widget, size);
 42#endif
 43 return WebCore::WidgetBackingStoreCairo::create(widget, size);
 44}
 45
 46} // namespace WebCore
 47
 48
0

Source/WebCore/platform/cairo/WidgetBackingStore.h

3535
3636namespace WebCore {
3737
38 class WidgetBackingStorePrivate;
39 
4038#if PLATFORM(GTK)
4139typedef GtkWidget* PlatformWidget;
4240#elif PLATFORM(EFL)

5048public:
5149 static PassOwnPtr<WidgetBackingStore> create(PlatformWidget, const IntSize&);
5250
53  ~WidgetBackingStore();
54  cairo_surface_t* cairoSurface();
55  void scroll(const IntRect& scrollRect, const IntSize& scrollOffset);
 51 virtual cairo_surface_t* cairoSurface() = 0;
 52 virtual void scroll(const IntRect& scrollRect, const IntSize& scrollOffset) = 0;
5653 const IntSize& size() { return m_size; }
 54 WidgetBackingStore(const IntSize& size) : m_size(size) { }
 55 virtual ~WidgetBackingStore() { }
5756
5857private:
59  WidgetBackingStore(PlatformWidget, const IntSize&);
60 
61  OwnPtr<WidgetBackingStorePrivate> m_private;
6258 IntSize m_size;
6359};
6460
150575

Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp

1818 */
1919
2020#include "config.h"
21 #include "WidgetBackingStore.h"
 21#include "WidgetBackingStoreCairo.h"
2222
2323#include "CairoUtilities.h"
2424#include "RefPtrCairo.h"
2525#include <cairo.h>
2626
27 #if PLATFORM(GTK)
28 #include "GtkVersioning.h"
29 #endif
30 
3127namespace WebCore {
3228
3329static PassRefPtr<cairo_surface_t> createSurfaceForBackingStore(PlatformWidget widget, const IntSize& size)

6460 }
6561};
6662
67 PassOwnPtr<WidgetBackingStore> WidgetBackingStore::create(PlatformWidget widget, const IntSize& size)
 63PassOwnPtr<WidgetBackingStore> WidgetBackingStoreCairo::create(PlatformWidget widget, const IntSize& size)
6864{
69  return adoptPtr(new WidgetBackingStore(widget, size));
 65 return adoptPtr(new WidgetBackingStoreCairo(widget, size));
7066}
7167
72 WidgetBackingStore::WidgetBackingStore(PlatformWidget widget, const IntSize& size)
73  : m_private(WidgetBackingStorePrivate::create(widget, size))
74  , m_size(size)
 68WidgetBackingStoreCairo::WidgetBackingStoreCairo(PlatformWidget widget, const IntSize& size)
 69 : WidgetBackingStore(size)
7570{
 71 m_private = WidgetBackingStorePrivate::create(widget, size);
7672}
7773
78 WidgetBackingStore::~WidgetBackingStore()
 74WidgetBackingStoreCairo::~WidgetBackingStoreCairo()
7975{
8076}
8177
82 cairo_surface_t* WidgetBackingStore::cairoSurface()
 78cairo_surface_t* WidgetBackingStoreCairo::cairoSurface()
8379{
8480 return m_private->m_surface.get();
8581}
8682
87 void WidgetBackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
 83void WidgetBackingStoreCairo::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
8884{
8985 IntRect targetRect(scrollRect);
9086 targetRect.move(scrollOffset);
150575

Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h

 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
 24namespace WebCore {
 25
 26class WidgetBackingStorePrivate;
 27
 28class WidgetBackingStoreCairo : public WidgetBackingStore {
 29
 30public:
 31 static PassOwnPtr<WidgetBackingStore> create(PlatformWidget, const IntSize&);
 32 WidgetBackingStoreCairo(PlatformWidget, const IntSize&);
 33 ~WidgetBackingStoreCairo();
 34 cairo_surface_t* cairoSurface();
 35 void scroll(const IntRect&, const IntSize&);
 36private:
 37 OwnPtr<WidgetBackingStorePrivate> m_private;
 38};
 39
 40} // namespace WebCore
 41
 42#endif // WidgetBackingStoreCairo_h
0

Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.h

 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
 24namespace WebCore {
 25
 26class WidgetBackingStorePrivate;
 27
 28class GtkWidgetBackingStoreX11 : public WidgetBackingStore {
 29
 30public:
 31 static PassOwnPtr<WidgetBackingStore> create(GtkWidget*, const IntSize&);
 32 GtkWidgetBackingStoreX11(GtkWidget*, const IntSize&);
 33 ~GtkWidgetBackingStoreX11();
 34 cairo_surface_t* cairoSurface();
 35 void scroll(const IntRect& scrollRect, const IntSize& scrollOffset);
 36private:
 37 OwnPtr<WidgetBackingStorePrivate> m_private;
 38};
 39
 40} // namespace WebCore
 41
 42#endif // GtkWidgetBackingStoreX11_h
0

Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp

1717 */
1818
1919#include "config.h"
20 #include "WidgetBackingStore.h"
 20#include "GtkWidgetBackingStoreX11.h"
2121
2222#include "GtkVersioning.h"
2323#include "RefPtrCairo.h"

7070 }
7171};
7272
73 PassOwnPtr<WidgetBackingStore> WidgetBackingStore::create(GtkWidget* widget, const IntSize& size)
 73PassOwnPtr<WidgetBackingStore> GtkWidgetBackingStoreX11::create(GtkWidget* widget, const IntSize& size)
7474{
75  return adoptPtr(new WidgetBackingStore(widget, size));
 75 return adoptPtr(new GtkWidgetBackingStoreX11(widget, size));
7676}
7777
78 WidgetBackingStore::WidgetBackingStore(GtkWidget* widget, const IntSize& size)
79  : m_private(WidgetBackingStorePrivate::create(widget, size))
80  , m_size(size)
 78GtkWidgetBackingStoreX11::GtkWidgetBackingStoreX11(GtkWidget* widget, const IntSize& size)
 79 : WidgetBackingStore(size)
8180{
 81 m_private = WidgetBackingStorePrivate::create(widget, size);
8282}
8383
84 WidgetBackingStore::~WidgetBackingStore()
 84GtkWidgetBackingStoreX11::~GtkWidgetBackingStoreX11()
8585{
8686}
8787
88 cairo_surface_t* WidgetBackingStore::cairoSurface()
 88cairo_surface_t* GtkWidgetBackingStoreX11::cairoSurface()
8989{
9090 return m_private->m_surface.get();
9191}
9292
93 void WidgetBackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
 93void GtkWidgetBackingStoreX11::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
9494{
9595 IntRect targetRect(scrollRect);
9696 targetRect.move(scrollOffset);
150575