[EFL] Move GtkWidgetBackingStoreCairo to the cairo directory and modify to use in the EFL.

https://bugs.webkit.org/show_bug.cgi?id=63502

Patch by Eunmi Lee <eunmi15.lee@samsung.com> on 2011-09-25
Reviewed by Martin Robinson.

The gtk/GtkWidgetBackingStoreCairo.cpp is moved to the cairo/WidgetBackingStoreCairo.cpp and
some codes for EFL are added.
WidgetBackingStoreCairo creates cairo_image_surface and has a role to copy reusable area
when scrolling. So, it will be used in the WebKit2 EFL port's BackingStore.

* CMakeListsEfl.txt:
* GNUmakefile.list.am:
* platform/cairo/WidgetBackingStore.h:
* platform/cairo/WidgetBackingStoreCairo.cpp: Renamed from Source/WebCore/platform/gtk/GtkWidgetBackingStoreCairo.cpp.
(WebCore::createSurfaceForBackingStore):
(WebCore::WidgetBackingStorePrivate::create):
(WebCore::WidgetBackingStorePrivate::WidgetBackingStorePrivate):
(WebCore::WidgetBackingStore::create):
(WebCore::WidgetBackingStore::WidgetBackingStore):
(WebCore::WidgetBackingStore::~WidgetBackingStore):
(WebCore::WidgetBackingStore::cairoSurface):
(WebCore::WidgetBackingStore::scroll):
* platform/gtk/GtkWidgetBackingStoreX11.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 69c8c196
......@@ -82,9 +82,11 @@ LIST(APPEND WebCore_USER_AGENT_STYLE_SHEETS
IF (WTF_USE_CAIRO)
LIST(APPEND WebCore_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform/cairo"
"${WEBCORE_DIR}/platform/graphics/cairo"
)
LIST(APPEND WebCore_SOURCES
platform/cairo/WidgetBackingStoreCairo.cpp
platform/graphics/cairo/CairoUtilities.cpp
platform/graphics/cairo/FontCairo.cpp
platform/graphics/cairo/GradientCairo.cpp
......
2011-09-25 Eunmi Lee <eunmi15.lee@samsung.com>
[EFL] Move GtkWidgetBackingStoreCairo to the cairo directory and modify to use in the EFL.
https://bugs.webkit.org/show_bug.cgi?id=63502
Reviewed by Martin Robinson.
The gtk/GtkWidgetBackingStoreCairo.cpp is moved to the cairo/WidgetBackingStoreCairo.cpp and
some codes for EFL are added.
WidgetBackingStoreCairo creates cairo_image_surface and has a role to copy reusable area
when scrolling. So, it will be used in the WebKit2 EFL port's BackingStore.
* CMakeListsEfl.txt:
* GNUmakefile.list.am:
* platform/cairo/WidgetBackingStore.h:
* platform/cairo/WidgetBackingStoreCairo.cpp: Renamed from Source/WebCore/platform/gtk/GtkWidgetBackingStoreCairo.cpp.
(WebCore::createSurfaceForBackingStore):
(WebCore::WidgetBackingStorePrivate::create):
(WebCore::WidgetBackingStorePrivate::WidgetBackingStorePrivate):
(WebCore::WidgetBackingStore::create):
(WebCore::WidgetBackingStore::WidgetBackingStore):
(WebCore::WidgetBackingStore::~WidgetBackingStore):
(WebCore::WidgetBackingStore::cairoSurface):
(WebCore::WidgetBackingStore::scroll):
* platform/gtk/GtkWidgetBackingStoreX11.cpp:
2011-09-25 Adam Barth <abarth@webkit.org>
Finish removing PLATFORM(BREWMP) by removing associated code
......@@ -3988,8 +3988,6 @@ webcoregtk_sources += \
Source/WebCore/platform/gtk/GtkClickCounter.h \
Source/WebCore/platform/gtk/GtkUtilities.cpp \
Source/WebCore/platform/gtk/GtkUtilities.h \
Source/WebCore/platform/gtk/GtkWidgetBackingStoreCairo.cpp \
Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp \
Source/WebCore/platform/gtk/GeolocationServiceGtk.cpp \
Source/WebCore/platform/gtk/GeolocationServiceGtk.h \
Source/WebCore/platform/gtk/GOwnPtrGtk.cpp \
......@@ -4039,6 +4037,7 @@ webcoregtk_sources += \
if TARGET_X11
webcoregtk_sources += \
Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp \
Source/WebCore/plugins/gtk/gtk2xtbin.c \
Source/WebCore/plugins/gtk/gtk2xtbin.h \
Source/WebCore/plugins/gtk/xembed.h
......@@ -4048,6 +4047,7 @@ if TARGET_WIN32
webcore_sources += \
Source/WebCore/platform/ScrollAnimatorWin.cpp \
Source/WebCore/platform/ScrollAnimatorWin.h \
Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp \
Source/WebCore/platform/win/SystemInfo.cpp \
Source/WebCore/platform/win/SystemInfo.h \
Source/WebCore/plugins/win/PluginDatabaseWin.cpp \
......
......@@ -27,6 +27,8 @@
#if PLATFORM(GTK)
#include <gtk/gtk.h>
#elif PLATFORM(EFL)
#include <Evas.h>
#endif
namespace WebCore {
......@@ -35,6 +37,8 @@ class WidgetBackingStorePrivate;
#if PLATFORM(GTK)
typedef GtkWidget* PlatformWidget;
#elif PLATFORM(EFL)
typedef Evas_Object* PlatformWidget;
#endif
class WidgetBackingStore {
......
/*
* Copyright (C) 2011, Igalia S.L.
* Copyright (C) 2011 Samsung Electronics
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -19,22 +20,27 @@
#include "config.h"
#include "WidgetBackingStore.h"
#ifndef XP_UNIX
#include "CairoUtilities.h"
#include "RefPtrCairo.h"
#include <cairo/cairo.h>
#if PLATFORM(GTK)
#include "GtkVersioning.h"
#endif
namespace WebCore {
static PassRefPtr<cairo_surface_t> createSurfaceForBackingStore(GtkWidget* widget, const IntSize& size)
static PassRefPtr<cairo_surface_t> createSurfaceForBackingStore(PlatformWidget widget, const IntSize& size)
{
#if PLATFORM(GTK)
return gdk_window_create_similar_surface(gtk_widget_get_window(widget),
CAIRO_CONTENT_COLOR_ALPHA,
size.width(), size.height());
#else
return adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, size.width(), size.height()));
#endif
}
class WidgetBackingStorePrivate {
WTF_MAKE_NONCOPYABLE(WidgetBackingStorePrivate);
WTF_MAKE_FAST_ALLOCATED;
......@@ -43,7 +49,7 @@ public:
RefPtr<cairo_surface_t> m_surface;
RefPtr<cairo_surface_t> m_scrollSurface;
static PassOwnPtr<WidgetBackingStorePrivate> create(GtkWidget* widget, const IntSize& size)
static PassOwnPtr<WidgetBackingStorePrivate> create(PlatformWidget widget, const IntSize& size)
{
return adoptPtr(new WidgetBackingStorePrivate(widget, size));
}
......@@ -52,19 +58,19 @@ private:
// We keep two copies of the surface here, which will double the memory usage, but increase
// scrolling performance since we do not have to keep reallocating a memory region during
// quick scrolling requests.
WidgetBackingStorePrivate(GtkWidget* widget, const IntSize& size)
WidgetBackingStorePrivate(PlatformWidget widget, const IntSize& size)
: m_surface(createSurfaceForBackingStore(widget, size))
, m_scrollSurface(createSurfaceForBackingStore(widget, size))
{
}
};
PassOwnPtr<WidgetBackingStore> WidgetBackingStore::create(GtkWidget* widget, const IntSize& size)
PassOwnPtr<WidgetBackingStore> WidgetBackingStore::create(PlatformWidget widget, const IntSize& size)
{
return adoptPtr(new WidgetBackingStore(widget, size));
}
WidgetBackingStore::WidgetBackingStore(GtkWidget* widget, const IntSize& size)
WidgetBackingStore::WidgetBackingStore(PlatformWidget widget, const IntSize& size)
: m_private(WidgetBackingStorePrivate::create(widget, size))
{
}
......@@ -94,5 +100,3 @@ void WidgetBackingStore::scroll(const IntRect& scrollRect, const IntSize& scroll
}
} // namespace WebCore
#endif // !XP_UNIX
......@@ -19,8 +19,6 @@
#include "config.h"
#include "WidgetBackingStore.h"
#ifdef XP_UNIX
#include "GtkVersioning.h"
#include "RefPtrCairo.h"
#include <X11/Xlib.h>
......@@ -107,5 +105,3 @@ void WidgetBackingStore::scroll(const IntRect& scrollRect, const IntSize& scroll
}
} // namespace WebCore
#endif // XP_UNIX
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment