ChangeLog

 12011-03-14 Julien Chaffraix <jchaffraix@codeaurora.org>, Zaheer Ahmad <zahmad@codeaurora.org>, and Joone Hur <joone.hur@collabora.co.uk>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [Gtk] Port tiled backing store
 6 https://bugs.webkit.org/show_bug.cgi?id=45423
 7
 8 * configure.ac: Add Tile Backing Store feature configuration.
 9
1102011-03-10 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
211
312 Reviewed by Laszlo Gombos.

Source/JavaScriptCore/ChangeLog

 12011-03-14 Joone Hur <joone.hur@collabora.co.uk>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [Gtk] Port tiled backing store
 6 https://bugs.webkit.org/show_bug.cgi?id=45423
 7
 8 cairo_rectangle_int_t doesn't need to be defined as the name of GdkRectangle.
 9
 10 * wtf/gobject/GTypedefs.h: cairo_rectangle_int_t is only defined if PLATFORM(CAIRO).
 11
1122011-03-13 Geoffrey Garen <ggaren@apple.com>
213
314 Reviewed by Oliver Hunt.

Source/JavaScriptCore/wtf/gobject/GTypedefs.h

@@typedef struct _GdkDragContext GdkDragContext;
4747typedef struct _GdkEventConfigure GdkEventConfigure;
4848typedef struct _GdkEventExpose GdkEventExpose;
4949typedef struct _GdkPixbuf GdkPixbuf;
 50typedef struct _GdkRegion GdkRegion;
5051typedef struct _GError GError;
5152typedef struct _GFile GFile;
5253typedef struct _GHashTable GHashTable;

@@typedef union _GdkEvent GdkEvent;
6364
6465#if PLATFORM(CAIRO)
6566typedef struct _cairo_surface cairo_surface_t;
 67typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
6668#endif
6769
6870#if PLATFORM(GTK)

@@typedef struct _GdkRectangle GdkRectangle;
8789typedef struct _GdkDrawable GdkWindow;
8890#else
8991typedef struct _GdkWindow GdkWindow;
90 typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
91 typedef cairo_rectangle_int_t GdkRectangle;
9292typedef struct _GtkStyleContext GtkStyleContext;
9393#endif
9494

Source/WebCore/ChangeLog

 12011-03-14 Julien Chaffraix <jchaffraix@codeaurora.org>, Zaheer Ahmad <zahmad@codeaurora.org>, and Joone Hur <joone.hur@collabora.co.uk>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [Gtk] Port tiled backing store
 6 https://bugs.webkit.org/show_bug.cgi?id=45423
 7
 8 Add the GTK port of tiling mechanism implemented in 35146.
 9
 10 * GNUmakefile.am: Feature defines and addition of files for compilation for the tile
 11 backing store.
 12 * platform/graphics/IntRect.h: cairo_rectangle_int_t is defined if PLATFORM(CAIRO)
 13 * platform/graphics/Tile.h:
 14 * platform/graphics/TiledBackingStore.cpp:
 15 (WebCore::TiledBackingStore::TiledBackingStore): Call setTileSize to apply the default
 16 tile size.
 17 * platform/graphics/cairo/IntRectCairo.cpp: Added to work with cairo_rectangle_int_t.
 18 (WebCore::IntRect::IntRect):
 19 (WebCore::IntRect::operator cairo_rectangle_int_t):
 20 * platform/graphics/cairo/OwnPtrCairo.cpp:
 21 (WTF::cairo_region_t): Added.
 22 * platform/graphics/cairo/OwnPtrCairo.h:
 23 * platform/graphics/cairo/TileCairo.cpp: Added to implement the Tile interface.
 24 (WebCore::checkeredSurface):
 25 (WebCore::Tile::Tile):
 26 (WebCore::Tile::~Tile):
 27 (WebCore::Tile::isDirty):
 28 (WebCore::Tile::isReadyToPaint):
 29 (WebCore::Tile::invalidate):
 30 (WebCore::regionToRects):
 31 (WebCore::Tile::updateBackBuffer):
 32 (WebCore::Tile::swapBackBufferToFront):
 33 (WebCore::Tile::paint):
 34 (WebCore::Tile::paintCheckerPattern):
 35 * platform/graphics/gtk/IntRectGtk.cpp: This can be compiled if GTK_API_VERSION_2.
 36 * platform/gtk/GOwnPtrGtk.cpp:
 37 (WTF::GdkRegion): Added.
 38 * platform/gtk/GOwnPtrGtk.h:
 39
1402011-03-13 David Sosby <dsosby@rim.com>
241
342 Reviewed by Dan Bernstein.

Source/WebCore/GNUmakefile.am

@@webcoregtk_sources += \
37303730 Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp \
37313731 Source/WebCore/platform/graphics/cairo/ImageBufferData.h \
37323732 Source/WebCore/platform/graphics/cairo/ImageCairo.cpp \
 3733 Source/WebCore/platform/graphics/cairo/IntRectCairo.cpp \
37333734 Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp \
37343735 Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h \
37353736 Source/WebCore/platform/graphics/cairo/PathCairo.cpp \

@@FEATURE_DEFINES += WTF_USE_NATIVE_GTK_MAIN_FRAME_SCROLLBAR=1
39063907webcore_cppflags += -DWTF_USE_NATIVE_GTK_MAIN_FRAME_SCROLLBAR=1
39073908endif # END WEBKIT2
39083909
 3910if ENABLE_TILED_BACKING_STORE
 3911FEATURE_DEFINES += ENABLE_TILED_BACKING_STORE=1
 3912
 3913webcore_cppflags += \
 3914 -DENABLE_TILED_BACKING_STORE=1
 3915
 3916webcore_sources += \
 3917 Source/WebCore/platform/graphics/Tile.h \
 3918 Source/WebCore/platform/graphics/TiledBackingStore.h \
 3919 Source/WebCore/platform/graphics/TiledBackingStoreClient.h \
 3920 Source/WebCore/platform/graphics/TiledBackingStore.cpp \
 3921 Source/WebCore/platform/graphics/cairo/TileCairo.cpp
 3922endif # END ENABLE_TILED_BACKING_STORE
 3923
39093924# ---
39103925# Channel mesaging support
39113926# ---

Source/WebCore/platform/graphics/IntRect.h

@@QT_END_NAMESPACE
5050#elif PLATFORM(GTK)
5151#ifdef GTK_API_VERSION_2
5252typedef struct _GdkRectangle GdkRectangle;
53 #else
54 typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
55 typedef cairo_rectangle_int_t GdkRectangle;
5653#endif
5754#elif PLATFORM(HAIKU)
5855class BRect;

@@class BRect;
6057typedef struct _Eina_Rectangle Eina_Rectangle;
6158#endif
6259
 60#if PLATFORM(CAIRO)
 61typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
 62#endif
 63
6364#if PLATFORM(WX)
6465class wxRect;
6566#endif

@@public:
172173 IntRect(const QRect&);
173174 operator QRect() const;
174175#elif PLATFORM(GTK)
 176#ifdef GTK_API_VERSION_2
175177 IntRect(const GdkRectangle&);
176178 operator GdkRectangle() const;
 179#endif
177180#elif PLATFORM(HAIKU)
178181 explicit IntRect(const BRect&);
179182 operator BRect() const;

@@public:
182185 operator Eina_Rectangle() const;
183186#endif
184187
 188#if PLATFORM(CAIRO)
 189 IntRect(const cairo_rectangle_int_t&);
 190 operator cairo_rectangle_int_t() const;
 191#endif
 192
185193#if PLATFORM(CG)
186194 operator CGRect() const;
187195#endif

Source/WebCore/platform/graphics/Tile.h

2828#include <wtf/PassRefPtr.h>
2929#include <wtf/RefCounted.h>
3030
 31#if PLATFORM(CAIRO)
 32#include "OwnPtrCairo.h"
 33#include <cairo.h>
 34#endif
 35
3136#if PLATFORM(QT)
3237QT_BEGIN_NAMESPACE
3338class QPixmap;

@@private:
7176 QPixmap* m_backBuffer;
7277 QRegion* m_dirtyRegion;
7378#endif
 79
 80#if PLATFORM(CAIRO)
 81 RefPtr<cairo_surface_t> m_buffer;
 82 OwnPtr<cairo_region_t> m_dirtyRegion;
 83#endif
 84
7485};
7586
7687}

Source/WebCore/platform/graphics/TiledBackingStore.cpp

@@TiledBackingStore::TiledBackingStore(TiledBackingStoreClient* client)
4242 , m_pendingScale(0)
4343 , m_contentsFrozen(false)
4444{
 45 setTileSize(m_tileSize);
4546}
4647
4748TiledBackingStore::~TiledBackingStore()

Source/WebCore/platform/graphics/cairo/IntRectCairo.cpp

 1/*
 2 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
 3 * Copyright (C) 2011 Collabora Ltd.
 4 *
 5 * This library is free software; you can redistribute it and/or
 6 * modify it under the terms of the GNU Library General Public
 7 * License as published by the Free Software Foundation; either
 8 * version 2 of the License, or (at your option) any later version.
 9 *
 10 * This library is distributed in the hope that it will be useful,
 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 13 * Library General Public License for more details.
 14 *
 15 * You should have received a copy of the GNU Library General Public License
 16 * along with this library; see the file COPYING.LIB. If not, write to
 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 18 * Boston, MA 02110-1301, USA.
 19 */
 20
 21#include "config.h"
 22#include "IntRect.h"
 23
 24#include <cairo.h>
 25
 26namespace WebCore {
 27
 28IntRect::IntRect(const cairo_rectangle_int_t& r)
 29 : m_location(IntPoint(r.x, r.y))
 30 , m_size(r.width, r.height)
 31{
 32}
 33
 34IntRect::operator cairo_rectangle_int_t() const
 35{
 36 cairo_rectangle_int_t r = { x(), y(), width(), height() };
 37 return r;
 38}
 39
 40}

Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp

@@template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t* ptr)
4949 cairo_path_destroy(ptr);
5050}
5151
 52template <> void deleteOwnedPtr<cairo_region_t>(cairo_region_t* ptr)
 53{
 54 if (ptr)
 55 cairo_region_destroy(ptr);
 56}
 57
5258} // namespace WTF

Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h

@@typedef struct _FcFontSet FcFontSet;
2828#endif
2929
3030typedef struct cairo_path cairo_path_t;
 31typedef struct _cairo_region cairo_region_t;
3132
3233namespace WTF {
3334

@@template <> void deleteOwnedPtr<FcFontSet>(FcFontSet*);
3738#endif
3839
3940template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t*);
 41template <> void deleteOwnedPtr<cairo_region_t>(cairo_region_t*);
4042
4143} // namespace WTF
4244

Source/WebCore/platform/graphics/cairo/TileCairo.cpp

 1/*
 2 * Copyright (C) 2010 codeaurora.org All rights reserved.
 3 * Copyright (C) 2011 Collabora Ltd.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 * 3. The name of the author may not be used to endorse or promote products
 14 * derived from this software without specific prior written permission.
 15 *
 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 26 */
 27
 28#include "config.h"
 29#include "Tile.h"
 30
 31#if ENABLE(TILED_BACKING_STORE)
 32
 33#include "CairoUtilities.h"
 34#include "GraphicsContext.h"
 35#include "TiledBackingStore.h"
 36#include "TiledBackingStoreClient.h"
 37#include <OwnPtrCairo.h>
 38#include <RefPtrCairo.h>
 39
 40namespace WebCore {
 41
 42static const unsigned checkerSize = 16;
 43static const unsigned checkerColor1 = 0xff555555;
 44static const unsigned checkerColor2 = 0xffaaaaaa;
 45
 46static cairo_surface_t* checkeredSurface()
 47{
 48 static cairo_surface_t* surface = 0;
 49 if (surface)
 50 return surface;
 51
 52 surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, checkerSize, checkerSize);
 53 RefPtr<cairo_t> cr = adoptRef(cairo_create(surface));
 54
 55 for (unsigned y = 0; y < checkerSize; y += checkerSize / 2) {
 56 bool alternate = y % checkerSize;
 57 for (unsigned x = 0; x < checkerSize; x += checkerSize / 2) {
 58 if (alternate)
 59 setSourceRGBAFromColor(cr.get(), checkerColor1);
 60 else
 61 setSourceRGBAFromColor(cr.get(), checkerColor2);
 62 cairo_rectangle(cr.get(), x, y, checkerSize / 2, checkerSize / 2);
 63 cairo_fill(cr.get());
 64 alternate = !alternate;
 65 }
 66 }
 67
 68 return surface;
 69}
 70
 71Tile::Tile(TiledBackingStore* backingStore, const Coordinate& tileCoordinate)
 72 : m_backingStore(backingStore)
 73 , m_coordinate(tileCoordinate)
 74 , m_rect(m_backingStore->tileRectForCoordinate(tileCoordinate))
 75{
 76 cairo_rectangle_int_t rect = m_rect;
 77 m_dirtyRegion = cairo_region_create_rectangle(&rect);
 78}
 79
 80Tile::~Tile()
 81{
 82}
 83
 84bool Tile::isDirty() const
 85{
 86 return !cairo_region_is_empty(m_dirtyRegion.get());
 87}
 88
 89bool Tile::isReadyToPaint() const
 90{
 91 return m_buffer;
 92}
 93
 94void Tile::invalidate(const IntRect& dirtyRect)
 95{
 96 IntRect tileDirtyRect = intersection(dirtyRect, m_rect);
 97 if (tileDirtyRect.isEmpty())
 98 return;
 99
 100 cairo_rectangle_int_t rect = tileDirtyRect;
 101 cairo_region_union_rectangle(m_dirtyRegion.get(), &rect);
 102
 103}
 104
 105static void regionToRects(cairo_region_t* region, Vector<IntRect>& updateRects)
 106{
 107 int rectCount = cairo_region_num_rectangles(region);
 108 OwnPtr<cairo_rectangle_int_t> rects(new cairo_rectangle_int_t[rectCount]);
 109 for (int i = 0; i < rectCount; i++) {
 110 cairo_region_get_rectangle(region, i, rects.get() + i);
 111 updateRects.append(IntRect(rects.get()[i]));
 112 }
 113}
 114
 115void Tile::updateBackBuffer()
 116{
 117 if (m_buffer && !isDirty())
 118 return;
 119
 120 if (!m_buffer)
 121 m_buffer = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, m_backingStore->m_tileSize.width(), m_backingStore->m_tileSize.height()));
 122
 123 Vector<IntRect> updateRects;
 124 regionToRects(m_dirtyRegion.get(), updateRects);
 125 m_dirtyRegion.clear();
 126 m_dirtyRegion.set(cairo_region_create());
 127
 128 RefPtr<cairo_t> cr = adoptRef(cairo_create(m_buffer.get()));
 129 GraphicsContext context(cr.get());
 130 context.translate(-m_rect.x(), -m_rect.y());
 131
 132 for (int i = 0; i < updateRects.size() ; ++i) {
 133 context.save();
 134 context.clip(FloatRect(updateRects[i]));
 135 context.scale(FloatSize(m_backingStore->m_contentsScale, m_backingStore->m_contentsScale));
 136 m_backingStore->m_client->tiledBackingStorePaint(&context, m_backingStore->mapToContents(updateRects[i]));
 137 context.restore();
 138 }
 139}
 140
 141void Tile::swapBackBufferToFront()
 142{
 143}
 144
 145void Tile::paint(GraphicsContext* context, const IntRect& rect)
 146{
 147 if (!m_buffer)
 148 return;
 149
 150 IntRect target = intersection(rect, m_rect);
 151 IntRect source(target.x() - m_rect.x(), target.y() - m_rect.y(), target.width(), target.height());
 152
 153 cairo_t* cr = context->platformContext();
 154 cairo_set_source_surface(cr, m_buffer.get(), target.x() - source.x(), target.y() - source.y());
 155 cairo_rectangle(cr, target.x(), target.y(), target.width(), target.height());
 156 cairo_fill(cr);
 157}
 158
 159void Tile::paintCheckerPattern(GraphicsContext* context, const FloatRect& target)
 160{
 161 cairo_t* cr = context->platformContext();
 162 cairo_set_source_surface(cr, checkeredSurface(), 0, 0);
 163 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
 164 cairo_rectangle(cr, target.x(), target.y(), target.width(), target.height());
 165 cairo_fill(cr);
 166}
 167
 168}
 169#endif // ENABLE(TILED_BACKING_STORE)

Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp

2222
2323#include <gdk/gdk.h>
2424
 25#ifdef GTK_API_VERSION_2
2526namespace WebCore {
2627
2728IntRect::IntRect(const GdkRectangle& r)

@@IntRect::operator GdkRectangle() const
3738}
3839
3940}
40 
 41#endif
4142// vim: ts=4 sw=4 et

Source/WebCore/platform/gtk/GOwnPtrGtk.cpp

@@template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo* info)
3535 gtk_icon_info_free(info);
3636}
3737
 38#ifdef GTK_API_VERSION_2
 39template <> void freeOwnedGPtr<GdkRegion>(GdkRegion* ptr)
 40{
 41 if (ptr)
 42 gdk_region_destroy(ptr);
 43}
 44#endif
 45
3846}

Source/WebCore/platform/gtk/GOwnPtrGtk.h

@@namespace WTF {
2727template <> void freeOwnedGPtr<GdkEvent>(GdkEvent*);
2828template <> void freeOwnedGPtr<GtkIconInfo>(GtkIconInfo*);
2929
 30#ifdef GTK_API_VERSION_2
 31template <> void freeOwnedGPtr<GdkRegion>(GdkRegion*);
 32#endif
 33
3034}
3135
3236#endif

Source/WebKit/gtk/ChangeLog

 12011-03-14 Julien Chaffraix <jchaffraix@codeaurora.org>, Zaheer Ahmad <zahmad@codeaurora.org>, and Joone Hur <joone.hur@collabora.co.uk>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [Gtk] Port tiled backing store
 6 https://bugs.webkit.org/show_bug.cgi?id=45423
 7
 8 Add the GTK port of tiling mechanism implemented in 35146.
 9
 10 * WebCoreSupport/ChromeClientGtk.cpp:
 11 (WebKit::ChromeClient::scroll): If enabled, use the backing store while scrolling.
 12 (WebKit::ChromeClient::delegatedScrollRequested):
 13 (WebKit::ChromeClient::contentsSizeChanged):
 14 (WebKit::ChromeClient::visibleRectForTiledBackingStore): Returns the visibleContentRect
 15 for the main frame.
 16 * WebCoreSupport/ChromeClientGtk.h:
 17 * webkit/webkitwebsettings.cpp:
 18 (webkit_web_settings_class_init):
 19 (webkit_web_settings_set_property):
 20 (webkit_web_settings_get_property):
 21 (webkit_web_settings_copy):
 22 * webkit/webkitwebview.cpp:
 23 (renderFromTiledBackingStore): Added to calculate the document dirty rect taking the
 24 scroll offsets and invoke the tile paint api.
 25 (paintWebView): Use the tile store if enabled when painting.
 26 (webkit_web_view_update_settings): Exposed a new property enable-tiled-backing-store on
 27 the webkitwebsettings object.
 28 (webkit_web_view_settings_notify):
 29
1302011-03-11 Marco Peereboom <marco@peereboom.us>
231
332 Reviewed by Gustavo Noronha Silva.

Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

6565#include "DatabaseTracker.h"
6666#endif
6767
 68#if ENABLE(TILED_BACKING_STORE)
 69#include "TiledBackingStore.h"
 70#endif
 71
6872using namespace WebCore;
6973
7074namespace WebKit {

@@void ChromeClient::scroll(const IntSize& delta, const IntRect& rectToScroll, con
411415
412416 m_pendingScrollInvalidations = true;
413417
 418#if ENABLE(TILED_BACKING_STORE)
 419 Frame* frame = core(m_webView)->mainFrame();
 420 if (frame && frame->tiledBackingStore())
 421 frame->tiledBackingStore()->adjustVisibleRect();
 422#endif
 423
414424 // We cannot use gdk_window_scroll here because it is only able to
415425 // scroll the whole window at once, and we often need to scroll
416426 // portions of the window only (think frames).

@@void ChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
504514 && (requisition.height != size.height())
505515 || (requisition.width != size.width()))
506516 gtk_widget_queue_resize_no_redraw(widget);
 517#if ENABLE(TILED_BACKING_STORE)
 518 if (frame && frame->tiledBackingStore())
 519 frame->tiledBackingStore()->adjustVisibleRect();
 520#endif
507521}
508522
509523void ChromeClient::scrollbarsModeDidChange() const

@@void ChromeClient::exitFullScreenForElement(WebCore::Element* element)
741755}
742756#endif
743757
 758#if ENABLE(TILED_BACKING_STORE)
 759IntRect ChromeClient::visibleRectForTiledBackingStore() const
 760{
 761 Frame* frame = core(m_webView)->mainFrame();
 762 if (!frame || !frame->view())
 763 return IntRect();
744764
 765 return frame->view()->visibleContentRect();
 766}
 767
 768void ChromeClient::delegatedScrollRequested(const IntPoint& delta)
 769{
 770}
 771#endif
745772}

Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h

@@namespace WebKit {
150150 virtual void exitFullScreenForElement(WebCore::Element*);
151151#endif
152152
 153#if ENABLE(TILED_BACKING_STORE)
 154 virtual WebCore::IntRect visibleRectForTiledBackingStore() const;
 155 virtual void delegatedScrollRequested(const WebCore::IntPoint&);
 156#endif
 157
153158 private:
154159 WebKitWebView* m_webView;
155160 WebCore::KURL m_hoveredLinkURL;

Source/WebKit/gtk/webkit/webkitwebsettings.cpp

@@struct _WebKitWebSettingsPrivate {
113113 gboolean enable_hyperlink_auditing;
114114 gboolean enable_fullscreen;
115115 gboolean enable_dns_prefetching;
 116 gboolean enable_tiled_backing_store;
116117};
117118
118119#define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate))

@@enum {
166167 PROP_ENABLE_JAVA_APPLET,
167168 PROP_ENABLE_HYPERLINK_AUDITING,
168169 PROP_ENABLE_FULLSCREEN,
169  PROP_ENABLE_DNS_PREFETCHING
 170 PROP_ENABLE_DNS_PREFETCHING,
 171 PROP_ENABLE_TILED_BACKING_STORE
170172};
171173
172174// Create a default user agent string

@@static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
929931 TRUE,
930932 flags));
931933
 934 /**
 935 * WebKitWebSettings: enable-tiled-backing-store:
 936 *
 937 * Whether to enable the the tiled backing store feature.
 938 * With the tiled backing store enabled, the content of the web page are cached to bitmap
 939 * tiles. These bitmap tiles are created and deleted on-demand as the viewport moves over
 940 * the web page.
 941 * Enabling tiling can significantly speed up painting heavy operations like scrolling,
 942 * but it consumes more memory. It does not work well with contents using CSS fixed
 943 * positioning. This property is disabled by default and will be ignored if the build
 944 * option is disabled.
 945 *
 946 * Since: 1.3.13
 947 */
 948 g_object_class_install_property(gobject_class,
 949 PROP_ENABLE_TILED_BACKING_STORE,
 950 g_param_spec_boolean("enable-tiled-backing-store",
 951 _("Enable Tiled Backing Store"),
 952 _("Whether Tiled Backing Store should be enabled"),
 953 FALSE,
 954 flags));
 955
932956 g_type_class_add_private(klass, sizeof(WebKitWebSettingsPrivate));
933957}
934958

@@static void webkit_web_settings_set_property(GObject* object, guint prop_id, con
11171141 case PROP_ENABLE_DNS_PREFETCHING:
11181142 priv->enable_dns_prefetching = g_value_get_boolean(value);
11191143 break;
 1144 case PROP_ENABLE_TILED_BACKING_STORE:
 1145 priv->enable_tiled_backing_store = g_value_get_boolean(value);
 1146 break;
11201147 default:
11211148 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
11221149 break;

@@static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa
12701297 case PROP_ENABLE_DNS_PREFETCHING:
12711298 g_value_set_boolean(value, priv->enable_dns_prefetching);
12721299 break;
 1300 case PROP_ENABLE_TILED_BACKING_STORE:
 1301 g_value_set_boolean(value, priv->enable_tiled_backing_store);
 1302 break;
12731303 default:
12741304 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
12751305 break;

@@WebKitWebSettings* webkit_web_settings_copy(WebKitWebSettings* web_settings)
13471377 "enable-hyperlink-auditing", priv->enable_hyperlink_auditing,
13481378 "enable-fullscreen", priv->enable_fullscreen,
13491379 "enable-dns-prefetching", priv->enable_dns_prefetching,
 1380 "enable-tiled-backing-store", priv->enable_tiled_backing_store,
13501381 NULL));
13511382
13521383 return copy;

Source/WebKit/gtk/webkit/webkitwebview.cpp

108108#include <wtf/gobject/GOwnPtr.h>
109109#include <wtf/text/CString.h>
110110
 111#if ENABLE(TILED_BACKING_STORE)
 112#include "TiledBackingStore.h"
 113#endif
 114
111115/**
112116 * SECTION:webkitwebview
113117 * @short_description: The central class of the WebKitGTK+ API

@@static bool shouldCoalesce(const IntRect& rect, const Vector<IntRect>& rects)
670674 return useUnionedRect;
671675}
672676
 677#if ENABLE(TILED_BACKING_STORE)
 678static void renderFromTiledBackingStore(Frame* frame, GraphicsContext* context, IntRect rect)
 679{
 680 ASSERT(frame->tiledBackingStore());
 681
 682 if (!frame->view() || !frame->contentRenderer())
 683 return;
 684
 685 FrameView* view = frame->view();
 686
 687 int scrollX = view->scrollX();
 688 int scrollY = view->scrollY();
 689
 690 context->translate(-scrollX, -scrollY);
 691 rect.move(scrollX, scrollY);
 692 frame->tiledBackingStore()->paint(context, rect);
 693}
 694#endif
 695
673696static void paintWebView(Frame* frame, gboolean transparent, GraphicsContext& context, const IntRect& clipRect, const Vector<IntRect>& rects)
674697{
675698 bool coalesce = true;

@@static void paintWebView(Frame* frame, gboolean transparent, GraphicsContext& co
681704 context.clip(clipRect);
682705 if (transparent)
683706 context.clearRect(clipRect);
 707#if ENABLE(TILED_BACKING_STORE)
 708 if (frame->tiledBackingStore())
 709 renderFromTiledBackingStore(frame, &context, clipRect);
 710 else
 711 frame->view()->paint(&context, clipRect);
 712#else
684713 frame->view()->paint(&context, clipRect);
 714#endif
685715 } else {
686716 for (size_t i = 0; i < rects.size(); i++) {
687717 IntRect rect = rects[i];

@@static void paintWebView(Frame* frame, gboolean transparent, GraphicsContext& co
689719 context.clip(rect);
690720 if (transparent)
691721 context.clearRect(rect);
 722#if ENABLE(TILED_BACKING_STORE)
 723 if (frame->tiledBackingStore())
 724 renderFromTiledBackingStore(frame, &context, clipRect);
 725 else
 726 frame->view()->paint(&context, rect);
 727#else
692728 frame->view()->paint(&context, rect);
 729#endif
693730 context.restore();
694731 }
695732 }

@@static void webkit_web_view_update_settings(WebKitWebView* webView)
32943331 enableUniversalAccessFromFileURI, enableFileAccessFromFileURI,
32953332 enableDOMPaste, tabKeyCyclesThroughElements,
32963333 enableSiteSpecificQuirks, usePageCache, enableJavaApplet,
3297  enableHyperlinkAuditing, enableFullscreen, enableDNSPrefetching;
 3334 enableHyperlinkAuditing, enableFullscreen, enableDNSPrefetching,
 3335 enableTiledBackingStore;
32983336
32993337 WebKitEditingBehavior editingBehavior;
33003338

@@static void webkit_web_view_update_settings(WebKitWebView* webView)
33363374 "spell-checking-languages", &defaultSpellCheckingLanguages,
33373375 "enable-fullscreen", &enableFullscreen,
33383376 "enable-dns-prefetching", &enableDNSPrefetching,
 3377 "enable-tiled-backing-store", &enableTiledBackingStore,
33393378 NULL);
33403379
33413380 settings->setDefaultTextEncodingName(defaultEncoding);

@@static void webkit_web_view_update_settings(WebKitWebView* webView)
33813420 static_cast<WebKit::TextCheckerClientEnchant*>(client->textChecker())->updateSpellCheckingLanguage(defaultSpellCheckingLanguages);
33823421#endif
33833422 settings->setDNSPrefetchingEnabled(enableDNSPrefetching);
 3423#if ENABLE(TILED_BACKING_STORE)
 3424 settings->setTiledBackingStoreEnabled(enableTiledBackingStore);
 3425#endif
33843426
33853427 Page* page = core(webView);
33863428 if (page)

@@static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
35043546 static_cast<WebKit::TextCheckerClientEnchant*>(client->textChecker())->updateSpellCheckingLanguage(g_value_get_string(&value));
35053547 }
35063548#endif
 3549 else if (name == g_intern_string("enable-tiled-backing-store"))
 3550 settings->setTiledBackingStoreEnabled(g_value_get_boolean(&value));
35073551 else if (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name))
35083552 g_warning("Unexpected setting '%s'", name);
35093553 g_value_unset(&value);

configure.ac

@@fi
248248
249249# minimum base dependencies
250250LIBSOUP_REQUIRED_VERSION=2.33.6
251 CAIRO_REQUIRED_VERSION=1.6
 251CAIRO_REQUIRED_VERSION=1.10
252252FONTCONFIG_REQUIRED_VERSION=2.4
253253FREETYPE2_REQUIRED_VERSION=9.0
254254LIBXML_REQUIRED_VERSION=2.6

@@AC_ARG_ENABLE(fast_mobile_scrolling,
745745 [],[enable_fast_mobile_scrolling="no"])
746746AC_MSG_RESULT([$enable_fast_mobile_scrolling])
747747
 748# Tile support
 749AC_MSG_CHECKING([whether to enable Tiled Backing Store])
 750AC_ARG_ENABLE(tiled_backing_store,
 751 AC_HELP_STRING([--enable-tiled-backing-store],
 752 [enable support for Tiled Backing Store[default=no]]),
 753 [],[enable_tiled_backing_store="no"])
 754AC_MSG_RESULT([$enable_tiled_backing_store])
 755
748756# check whether to enable code coverage
749757AC_MSG_CHECKING([whether to enable code coverage support])
750758AC_ARG_ENABLE(coverage,

@@AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
10231031AM_CONDITIONAL([ENABLE_DATALIST],[test "$enable_datalist" = "yes"])
10241032AM_CONDITIONAL([ENABLE_EVENTSOURCE],[test "$enable_eventsource" = "yes"])
10251033AM_CONDITIONAL([ENABLE_FAST_MOBILE_SCROLLING],[test "$enable_fast_mobile_scrolling" = "yes"])
 1034AM_CONDITIONAL([ENABLE_TILED_BACKING_STORE],[test "$enable_tiled_backing_store" = "yes"])
10261035AM_CONDITIONAL([ENABLE_FILE_SYSTEM],[test "$enable_file_system" = "yes"])
10271036AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
10281037AM_CONDITIONAL([ENABLE_IMAGE_RESIZER],[test "$enable_image_resizer" = "yes"])

@@Features:
11091118 Blob support : $enable_blob
11101119 Directory upload : $enable_directory_upload
11111120 Fast Mobile Scrolling : $enable_fast_mobile_scrolling
 1121 Tiled Backing Store : $enable_tiled_backing_store
11121122 JIT compilation : $enable_jit
11131123 Filters support : $enable_filters
11141124 Geolocation support : $enable_geolocation