| Differences between
and this patch
- a/ChangeLog +11 lines
Lines 1-3 a/ChangeLog_sec1
1
2011-05-29  Joone Hur  <joone.hur@collabora.co.uk>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        [GTK] Replace GdkRectangle by cairo_rectangle_int_t
6
        https://bugs.webkit.org/show_bug.cgi?id=60687
7
8
        Replace GdkRectangle by cairo_rectangle_int_t.
9
10
        * configure.ac: Check whether Cairo version is higher than 1.10.
11
1
2011-05-25  Gregg Tavares  <gman@chromium.org>
12
2011-05-25  Gregg Tavares  <gman@chromium.org>
2
13
3
        Reviewed by Kenneth Russell.
14
        Reviewed by Kenneth Russell.
- a/Source/JavaScriptCore/ChangeLog +11 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2011-05-29  Joone Hur  <joone.hur@collabora.co.uk>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        [GTK] Replace GdkRectangle by cairo_rectangle_int_t
6
        https://bugs.webkit.org/show_bug.cgi?id=60687
7
8
        Replace GdkRectangle by cairo_rectangle_int_t.
9
10
        * wtf/gobject/GTypedefs.h: Replace GdkRectangle by cairo_rectangle_int_t.
11
1
2011-05-28  David Kilzer  <ddkilzer@apple.com>
12
2011-05-28  David Kilzer  <ddkilzer@apple.com>
2
13
3
        BUILD FIX when building only the interpreter
14
        BUILD FIX when building only the interpreter
- a/Source/JavaScriptCore/wtf/gobject/GTypedefs.h -2 / +1 lines
Lines 63-68 typedef union _GdkEvent GdkEvent; a/Source/JavaScriptCore/wtf/gobject/GTypedefs.h_sec1
63
63
64
#if USE(CAIRO)
64
#if USE(CAIRO)
65
typedef struct _cairo_surface cairo_surface_t;
65
typedef struct _cairo_surface cairo_surface_t;
66
typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
66
#endif
67
#endif
67
68
68
#if PLATFORM(GTK)
69
#if PLATFORM(GTK)
Lines 87-94 typedef struct _GdkRectangle GdkRectangle; a/Source/JavaScriptCore/wtf/gobject/GTypedefs.h_sec2
87
typedef struct _GdkDrawable GdkWindow;
88
typedef struct _GdkDrawable GdkWindow;
88
#else
89
#else
89
typedef struct _GdkWindow GdkWindow;
90
typedef struct _GdkWindow GdkWindow;
90
typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
91
typedef cairo_rectangle_int_t GdkRectangle;
92
typedef struct _GtkStyleContext GtkStyleContext;
91
typedef struct _GtkStyleContext GtkStyleContext;
93
#endif
92
#endif
94
93
- a/Source/WebCore/ChangeLog +27 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2011-05-29  Joone Hur  <joone.hur@collabora.co.uk>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        [GTK] Replace GdkRectangle by cairo_rectangle_int_t
6
        https://bugs.webkit.org/show_bug.cgi?id=60687
7
8
        Replace GdkRectangle by cairo_rectangle_int_t.
9
10
        * GNUmakefile.list.am: Added IntRectCairo.cpp instead of IntRectGtk.cpp
11
        * platform/graphics/IntRect.h: IntRect class can be instantiated through the given cairo_rectangle_int_t 
12
        instead of GdkRectangle.
13
        * platform/graphics/cairo/GraphicsContextCairo.cpp: Remove the GTK+ code.
14
        (WebCore::GraphicsContext::drawFocusRing):
15
        * platform/graphics/cairo/IntRectCairo.cpp: Renamed from Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp.
16
        (WebCore::IntRect::IntRect): 
17
        (WebCore::IntRect::operator cairo_rectangle_int_t):
18
        * platform/graphics/cairo/OwnPtrCairo.cpp: OwnPtr support for cairo_region_t and cairo_rectangle_t.
19
        (WTF::cairo_region_t):
20
        (WTF::cairo_rectangle_t):
21
        * platform/graphics/cairo/OwnPtrCairo.h: Ditto.
22
        * platform/gtk/GtkPluginWidget.cpp: Replace GdkRectangle by cairo_rectangle_int_t.
23
        (WebCore::GtkPluginWidget::invalidateRect):
24
        (WebCore::GtkPluginWidget::paint):
25
        * plugins/gtk/PluginViewGtk.cpp: Replace GdkRectangle by cairo_rectangle_int_t.
26
        (WebCore::PluginView::updateWidgetAllocationAndClip):
27
1
2011-05-28  Alexey Proskuryakov  <ap@apple.com>
28
2011-05-28  Alexey Proskuryakov  <ap@apple.com>
2
29
3
        Suggested by Simon Fraser.
30
        Suggested by Simon Fraser.
- a/Source/WebCore/GNUmakefile.list.am -1 / +1 lines
Lines 3732-3737 webcoregtk_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec1
3732
	Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp \
3732
	Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp \
3733
	Source/WebCore/platform/graphics/cairo/ImageBufferData.h \
3733
	Source/WebCore/platform/graphics/cairo/ImageBufferData.h \
3734
	Source/WebCore/platform/graphics/cairo/ImageCairo.cpp \
3734
	Source/WebCore/platform/graphics/cairo/ImageCairo.cpp \
3735
	Source/WebCore/platform/graphics/cairo/IntRectCairo.cpp \
3735
	Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp \
3736
	Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp \
3736
	Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h \
3737
	Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h \
3737
	Source/WebCore/platform/graphics/cairo/PathCairo.cpp \
3738
	Source/WebCore/platform/graphics/cairo/PathCairo.cpp \
Lines 3767-3773 webcoregtk_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec2
3767
	Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp \
3768
	Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp \
3768
	Source/WebCore/platform/graphics/gtk/ImageGtk.cpp \
3769
	Source/WebCore/platform/graphics/gtk/ImageGtk.cpp \
3769
	Source/WebCore/platform/graphics/gtk/IntPointGtk.cpp \
3770
	Source/WebCore/platform/graphics/gtk/IntPointGtk.cpp \
3770
	Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp \
3771
	Source/WebCore/platform/gtk/ClipboardGtk.cpp \
3771
	Source/WebCore/platform/gtk/ClipboardGtk.cpp \
3772
	Source/WebCore/platform/gtk/ClipboardGtk.h \
3772
	Source/WebCore/platform/gtk/ClipboardGtk.h \
3773
	Source/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp \
3773
	Source/WebCore/platform/gtk/ClipboardUtilitiesGtk.cpp \
- a/Source/WebCore/platform/graphics/IntRect.h -6 / +9 lines
Lines 50-58 QT_END_NAMESPACE a/Source/WebCore/platform/graphics/IntRect.h_sec1
50
#elif PLATFORM(GTK)
50
#elif PLATFORM(GTK)
51
#ifdef GTK_API_VERSION_2
51
#ifdef GTK_API_VERSION_2
52
typedef struct _GdkRectangle GdkRectangle;
52
typedef struct _GdkRectangle GdkRectangle;
53
#else
54
typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
55
typedef cairo_rectangle_int_t GdkRectangle;
56
#endif
53
#endif
57
#elif PLATFORM(HAIKU)
54
#elif PLATFORM(HAIKU)
58
class BRect;
55
class BRect;
Lines 60-65 class BRect; a/Source/WebCore/platform/graphics/IntRect.h_sec2
60
typedef struct _Eina_Rectangle Eina_Rectangle;
57
typedef struct _Eina_Rectangle Eina_Rectangle;
61
#endif
58
#endif
62
59
60
#if USE(CAIRO)
61
typedef struct _cairo_rectangle_int cairo_rectangle_int_t;
62
#endif
63
63
#if PLATFORM(WX)
64
#if PLATFORM(WX)
64
class wxRect;
65
class wxRect;
65
#endif
66
#endif
Lines 181-189 public: a/Source/WebCore/platform/graphics/IntRect.h_sec3
181
#elif PLATFORM(QT)
182
#elif PLATFORM(QT)
182
    IntRect(const QRect&);
183
    IntRect(const QRect&);
183
    operator QRect() const;
184
    operator QRect() const;
184
#elif PLATFORM(GTK)
185
    IntRect(const GdkRectangle&);
186
    operator GdkRectangle() const;
187
#elif PLATFORM(HAIKU)
185
#elif PLATFORM(HAIKU)
188
    explicit IntRect(const BRect&);
186
    explicit IntRect(const BRect&);
189
    operator BRect() const;
187
    operator BRect() const;
Lines 192-197 public: a/Source/WebCore/platform/graphics/IntRect.h_sec4
192
    operator Eina_Rectangle() const;
190
    operator Eina_Rectangle() const;
193
#endif
191
#endif
194
192
193
#if USE(CAIRO)
194
    IntRect(const cairo_rectangle_int_t&);
195
    operator cairo_rectangle_int_t() const;
196
#endif
197
195
#if USE(CG) || USE(SKIA_ON_MAC_CHROME)
198
#if USE(CG) || USE(SKIA_ON_MAC_CHROME)
196
    operator CGRect() const;
199
    operator CGRect() const;
197
#endif
200
#endif
- a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp -24 / +1 lines
Lines 629-657 void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp_sec1
629
    cairo_push_group(cr);
629
    cairo_push_group(cr);
630
    cairo_new_path(cr);
630
    cairo_new_path(cr);
631
631
632
#if PLATFORM(GTK)
633
#ifdef GTK_API_VERSION_2
634
    GdkRegion* reg = gdk_region_new();
635
#else
636
    cairo_region_t* reg = cairo_region_create();
637
#endif
638
639
    for (unsigned i = 0; i < rectCount; i++) {
640
#ifdef GTK_API_VERSION_2
641
        GdkRectangle rect = rects[i];
642
        gdk_region_union_with_rect(reg, &rect);
643
#else
644
        cairo_rectangle_int_t rect = rects[i];
645
        cairo_region_union_rectangle(reg, &rect);
646
#endif
647
    }
648
    gdk_cairo_region(cr, reg);
649
#ifdef GTK_API_VERSION_2
650
    gdk_region_destroy(reg);
651
#else
652
    cairo_region_destroy(reg);
653
#endif
654
#else
655
    int radius = (width - 1) / 2;
632
    int radius = (width - 1) / 2;
656
    Path path;
633
    Path path;
657
    for (unsigned i = 0; i < rectCount; ++i) {
634
    for (unsigned i = 0; i < rectCount; ++i) {
Lines 660-666 void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp_sec2
660
        path.addRoundedRect(rects[i], FloatSize(radius, radius));
637
        path.addRoundedRect(rects[i], FloatSize(radius, radius));
661
        appendWebCorePathToCairoContext(cr, path);
638
        appendWebCorePathToCairoContext(cr, path);
662
    }
639
    }
663
#endif
640
664
    Color ringColor = color;
641
    Color ringColor = color;
665
    adjustFocusRingColor(ringColor);
642
    adjustFocusRingColor(ringColor);
666
    adjustFocusRingLineWidth(width);
643
    adjustFocusRingLineWidth(width);
- a/Source/WebCore/platform/graphics/cairo/IntRectCairo.cpp +40 lines
Line 0 a/Source/WebCore/platform/graphics/cairo/IntRectCairo.cpp_sec1
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
26
namespace WebCore {
27
28
IntRect::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
34
IntRect::operator cairo_rectangle_int_t() const
35
{
36
    cairo_rectangle_int_t r = { x(), y(), width(), height() };
37
    return r;
38
}
39
40
}
- a/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp +12 lines
Lines 49-52 template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t* ptr) a/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.cpp_sec1
49
        cairo_path_destroy(ptr);
49
        cairo_path_destroy(ptr);
50
}
50
}
51
51
52
template <> void deleteOwnedPtr<cairo_region_t>(cairo_region_t* ptr)
53
{
54
    if (ptr)
55
        cairo_region_destroy(ptr);
56
}
57
58
template <> void deleteOwnedPtr<cairo_rectangle_t>(cairo_rectangle_t* ptr)
59
{
60
    if (ptr)
61
        free(ptr);
62
}
63
52
} // namespace WTF
64
} // namespace WTF
- a/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h +4 lines
Lines 29-34 typedef struct _FcFontSet FcFontSet; a/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h_sec1
29
#endif
29
#endif
30
30
31
typedef struct cairo_path cairo_path_t;
31
typedef struct cairo_path cairo_path_t;
32
typedef struct _cairo_region cairo_region_t;
33
typedef struct _cairo_rectangle cairo_rectangle_t;
32
34
33
namespace WTF {
35
namespace WTF {
34
36
Lines 38-43 template <> void deleteOwnedPtr<FcFontSet>(FcFontSet*); a/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h_sec2
38
#endif
40
#endif
39
41
40
template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t*);
42
template <> void deleteOwnedPtr<cairo_path_t>(cairo_path_t*);
43
template <> void deleteOwnedPtr<cairo_region_t>(cairo_region_t*);
44
template <> void deleteOwnedPtr<cairo_rectangle_t>(cairo_rectangle_t*);
41
45
42
} // namespace WTF
46
} // namespace WTF
43
47
- a/Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp -41 lines
Lines 1-41 a/Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp_sec1
1
/*
2
 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Library 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
 * Library General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Library General Public License
15
 * along with this library; see the file COPYING.LIB.  If not, write to
16
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
#include "config.h"
21
#include "IntRect.h"
22
23
#include <gdk/gdk.h>
24
25
namespace WebCore {
26
27
IntRect::IntRect(const GdkRectangle& r)
28
    : m_location(IntPoint(r.x, r.y))
29
    , m_size(r.width, r.height)
30
{
31
}
32
33
IntRect::operator GdkRectangle() const
34
{
35
    GdkRectangle r = { x(), y(), width(), height() };
36
    return r;
37
}
38
39
}
40
41
// vim: ts=4 sw=4 et
- a/Source/WebCore/platform/gtk/GtkPluginWidget.cpp -4 / +5 lines
Lines 41-47 GtkPluginWidget::GtkPluginWidget(GtkWidget* widget) a/Source/WebCore/platform/gtk/GtkPluginWidget.cpp_sec1
41
    gtk_widget_hide(widget);
41
    gtk_widget_hide(widget);
42
}
42
}
43
43
44
void GtkPluginWidget::invalidateRect(const IntRect& _rect)
44
void GtkPluginWidget::invalidateRect(const IntRect& coreRect)
45
{
45
{
46
    /* no need to */
46
    /* no need to */
47
    if (!gtk_widget_get_has_window(platformWidget()))
47
    if (!gtk_widget_get_has_window(platformWidget()))
Lines 51-58 void GtkPluginWidget::invalidateRect(const IntRect& _rect) a/Source/WebCore/platform/gtk/GtkPluginWidget.cpp_sec2
51
    if (!window)
51
    if (!window)
52
        return;
52
        return;
53
53
54
    GdkRectangle rect = _rect;
54
    cairo_rectangle_int_t rect = coreRect;
55
    gdk_window_invalidate_rect(window, &rect, FALSE);
55
    gdk_window_invalidate_rect(window, reinterpret_cast<GdkRectangle*>(&rect), FALSE);
56
}
56
}
57
57
58
void GtkPluginWidget::frameRectsChanged()
58
void GtkPluginWidget::frameRectsChanged()
Lines 80-86 void GtkPluginWidget::paint(GraphicsContext* context, const IntRect& rect) a/Source/WebCore/platform/gtk/GtkPluginWidget.cpp_sec3
80
80
81
    GdkEvent* event = gdk_event_new(GDK_EXPOSE);
81
    GdkEvent* event = gdk_event_new(GDK_EXPOSE);
82
    event->expose = *context->gdkExposeEvent();
82
    event->expose = *context->gdkExposeEvent();
83
    event->expose.area = static_cast<GdkRectangle>(rect);
83
    cairo_rectangle_int_t rectangle = rect;
84
    event->expose.area = *reinterpret_cast<GdkRectangle*>(&rectangle); 
84
85
85
    IntPoint loc = parent()->contentsToWindow(rect.location());
86
    IntPoint loc = parent()->contentsToWindow(rect.location());
86
87
- a/Source/WebCore/plugins/gtk/PluginViewGtk.cpp -4 / +4 lines
Lines 550-558 void PluginView::updateWidgetAllocationAndClip() a/Source/WebCore/plugins/gtk/PluginViewGtk.cpp_sec1
550
550
551
    GtkWidget* widget = platformPluginWidget();
551
    GtkWidget* widget = platformPluginWidget();
552
    if (gtk_widget_get_realized(widget)) {
552
    if (gtk_widget_get_realized(widget)) {
553
        GdkRectangle clipRect = m_clipRect;
553
        cairo_rectangle_int_t clipRect = m_clipRect;
554
#ifdef GTK_API_VERSION_2
554
#ifdef GTK_API_VERSION_2
555
        GdkRegion* clipRegion = gdk_region_rectangle(&clipRect);
555
        GdkRegion* clipRegion = gdk_region_rectangle((GdkRectangle*)&clipRect);
556
        gdk_window_shape_combine_region(gtk_widget_get_window(widget), clipRegion, 0, 0);
556
        gdk_window_shape_combine_region(gtk_widget_get_window(widget), clipRegion, 0, 0);
557
        gdk_region_destroy(clipRegion);
557
        gdk_region_destroy(clipRegion);
558
#else
558
#else
Lines 561-568 void PluginView::updateWidgetAllocationAndClip() a/Source/WebCore/plugins/gtk/PluginViewGtk.cpp_sec2
561
        cairo_region_destroy(clipRegion);
561
        cairo_region_destroy(clipRegion);
562
#endif
562
#endif
563
    }
563
    }
564
564
    cairo_rectangle_int_t delayedRect = m_delayedAllocation;
565
    GtkAllocation allocation(m_delayedAllocation);
565
    GtkAllocation allocation(*reinterpret_cast<GdkRectangle*>(&delayedRect));
566
    gtk_widget_size_allocate(widget, &allocation);
566
    gtk_widget_size_allocate(widget, &allocation);
567
    m_delayedAllocation = IntRect();
567
    m_delayedAllocation = IntRect();
568
}
568
}
- a/Source/WebKit/gtk/ChangeLog +20 lines
Lines 1-3 a/Source/WebKit/gtk/ChangeLog_sec1
1
2011-05-29  Joone Hur  <joone.hur@collabora.co.uk>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        [GTK] Replace GdkRectangle by cairo_rectangle_int_t
6
        https://bugs.webkit.org/show_bug.cgi?id=60687
7
8
        Replace GdkRectangle by cairo_rectangle_int_t.
9
10
        * WebCoreSupport/ChromeClientGtk.cpp: Replace GdkRectangle by cairo_rectangle_int_t.
11
        (WebKit::ChromeClient::invalidateContentsAndWindow):
12
        (WebKit::ChromeClient::scroll):
13
        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: Ditto.
14
        (DumpRenderTreeSupportGtk::firstRectForCharacterRange):
15
        (DumpRenderTreeSupportGtk::rectangleForSelection):
16
        * WebCoreSupport/DumpRenderTreeSupportGtk.h: Ditto.
17
        * webkit/webkitwebview.cpp: Ditto.
18
        (webkit_web_view_expose_event):
19
        (webkit_web_view_query_tooltip):
20
1
2011-05-28  Adam Barth  <abarth@webkit.org>
21
2011-05-28  Adam Barth  <abarth@webkit.org>
2
22
3
        Reviewed by Alexey Proskuryakov.
23
        Reviewed by Alexey Proskuryakov.
- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp -8 / +8 lines
Lines 389-399 void ChromeClient::invalidateWindow(const IntRect&, bool immediate) a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp_sec1
389
389
390
void ChromeClient::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
390
void ChromeClient::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
391
{
391
{
392
    GdkRectangle rect = updateRect;
392
    cairo_rectangle_int_t rect = updateRect;
393
    GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(m_webView));
393
    GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(m_webView));
394
394
395
    if (window && !updateRect.isEmpty()) {
395
    if (window && !updateRect.isEmpty()) {
396
        gdk_window_invalidate_rect(window, &rect, FALSE);
396
        gdk_window_invalidate_rect(window, (GdkRectangle*)&rect, FALSE);
397
        // We don't currently do immediate updates since they delay other UI elements.
397
        // We don't currently do immediate updates since they delay other UI elements.
398
        //if (immediate)
398
        //if (immediate)
399
        //    gdk_window_process_updates(window, FALSE);
399
        //    gdk_window_process_updates(window, FALSE);
Lines 417-434 void ChromeClient::scroll(const IntSize& delta, const IntRect& rectToScroll, con a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp_sec2
417
    // We cannot use gdk_window_scroll here because it is only able to
417
    // We cannot use gdk_window_scroll here because it is only able to
418
    // scroll the whole window at once, and we often need to scroll
418
    // scroll the whole window at once, and we often need to scroll
419
    // portions of the window only (think frames).
419
    // portions of the window only (think frames).
420
    GdkRectangle area = clipRect;
420
    cairo_rectangle_int_t area = clipRect;
421
    GdkRectangle moveRect;
421
    cairo_rectangle_int_t moveRect;
422
422
423
    GdkRectangle sourceRect = area;
423
    cairo_rectangle_int_t sourceRect = area;
424
    sourceRect.x -= delta.width();
424
    sourceRect.x -= delta.width();
425
    sourceRect.y -= delta.height();
425
    sourceRect.y -= delta.height();
426
426
427
#ifdef GTK_API_VERSION_2
427
#ifdef GTK_API_VERSION_2
428
    GdkRegion* invalidRegion = gdk_region_rectangle(&area);
428
    GdkRegion* invalidRegion = gdk_region_rectangle((GdkRectangle*)&area);
429
429
430
    if (gdk_rectangle_intersect(&area, &sourceRect, &moveRect)) {
430
    if (gdk_rectangle_intersect((GdkRectangle*)&area, (GdkRectangle*)&sourceRect, (GdkRectangle*)&moveRect)) {
431
        GdkRegion* moveRegion = gdk_region_rectangle(&moveRect);
431
        GdkRegion* moveRegion = gdk_region_rectangle((GdkRectangle*)&moveRect);
432
        gdk_window_move_region(window, moveRegion, delta.width(), delta.height());
432
        gdk_window_move_region(window, moveRegion, delta.width(), delta.height());
433
        gdk_region_offset(moveRegion, delta.width(), delta.height());
433
        gdk_region_offset(moveRegion, delta.width(), delta.height());
434
        gdk_region_subtract(invalidRegion, moveRegion);
434
        gdk_region_subtract(invalidRegion, moveRegion);
- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp -2 / +2 lines
Lines 553-559 void DumpRenderTreeSupportGtk::confirmComposition(WebKitWebView* webView, const a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp_sec1
553
        editor->insertText(String::fromUTF8(text), 0);
553
        editor->insertText(String::fromUTF8(text), 0);
554
}
554
}
555
555
556
bool DumpRenderTreeSupportGtk::firstRectForCharacterRange(WebKitWebView* webView, int location, int length, GdkRectangle* rect)
556
bool DumpRenderTreeSupportGtk::firstRectForCharacterRange(WebKitWebView* webView, int location, int length, cairo_rectangle_int_t* rect)
557
{
557
{
558
    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
558
    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false);
559
    g_return_val_if_fail(rect, false);
559
    g_return_val_if_fail(rect, false);
Lines 782-788 void DumpRenderTreeSupportGtk::setValueForUser(JSContextRef context, JSValueRef a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp_sec2
782
    inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));
782
    inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));
783
}
783
}
784
784
785
void DumpRenderTreeSupportGtk::rectangleForSelection(WebKitWebFrame* frame, GdkRectangle* rectangle)
785
void DumpRenderTreeSupportGtk::rectangleForSelection(WebKitWebFrame* frame, cairo_rectangle_int_t* rectangle)
786
{
786
{
787
    Frame* coreFrame = core(frame);
787
    Frame* coreFrame = core(frame);
788
    if (!coreFrame)
788
    if (!coreFrame)
- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h -2 / +2 lines
Lines 99-109 public: a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h_sec1
99
    static bool findString(WebKitWebView*, const gchar*, WebKitFindOptions);
99
    static bool findString(WebKitWebView*, const gchar*, WebKitFindOptions);
100
    static void setComposition(WebKitWebView*, const char* text, int start, int end);
100
    static void setComposition(WebKitWebView*, const char* text, int start, int end);
101
    static void confirmComposition(WebKitWebView*, const char* text);
101
    static void confirmComposition(WebKitWebView*, const char* text);
102
    static bool firstRectForCharacterRange(WebKitWebView*, int location, int length, GdkRectangle*);
102
    static bool firstRectForCharacterRange(WebKitWebView*, int location, int length, cairo_rectangle_int_t*);
103
    static bool selectedRange(WebKitWebView*, int* start, int* end);
103
    static bool selectedRange(WebKitWebView*, int* start, int* end);
104
    static double defaultMinimumTimerInterval(); // Not really tied to WebView
104
    static double defaultMinimumTimerInterval(); // Not really tied to WebView
105
    static void setMinimumTimerInterval(WebKitWebView*, double);
105
    static void setMinimumTimerInterval(WebKitWebView*, double);
106
    static void rectangleForSelection(WebKitWebFrame*, GdkRectangle*);
106
    static void rectangleForSelection(WebKitWebFrame*, cairo_rectangle_int_t*);
107
    static void scalePageBy(WebKitWebView*, float, float, float);
107
    static void scalePageBy(WebKitWebView*, float, float, float);
108
108
109
    // Accessibility
109
    // Accessibility
- a/Source/WebKit/gtk/webkit/webkitwebview.cpp -8 / +9 lines
Lines 670-682 static gboolean webkit_web_view_expose_event(GtkWidget* widget, GdkEventExpose* a/Source/WebKit/gtk/webkit/webkitwebview.cpp_sec1
670
        gc.setGdkExposeEvent(event);
670
        gc.setGdkExposeEvent(event);
671
671
672
        int rectCount;
672
        int rectCount;
673
        GOwnPtr<GdkRectangle> rects;
673
        GOwnPtr<cairo_rectangle_int_t> rects;
674
        gdk_region_get_rectangles(event->region, &rects.outPtr(), &rectCount);
674
        gdk_region_get_rectangles(event->region, (GdkRectangle**)&rects.outPtr(), &rectCount);
675
        Vector<IntRect> paintRects;
675
        Vector<IntRect> paintRects;
676
        for (int i = 0; i < rectCount; i++)
676
        for (int i = 0; i < rectCount; i++)
677
            paintRects.append(IntRect(rects.get()[i]));
677
            paintRects.append(IntRect(rects.get()[i]));
678
678
  
679
        paintWebView(frame, priv->transparent, gc, static_cast<IntRect>(event->area), paintRects);
679
        cairo_rectangle_int_t rect = *reinterpret_cast<cairo_rectangle_int_t*>(&event->area);
680
        paintWebView(frame, priv->transparent, gc, static_cast<IntRect>(rect), paintRects);
680
    }
681
    }
681
682
682
    return FALSE;
683
    return FALSE;
Lines 1647-1654 static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y, a/Source/WebKit/gtk/webkit/webkitwebview.cpp_sec2
1647
                String title = static_cast<Element*>(titleNode)->title();
1648
                String title = static_cast<Element*>(titleNode)->title();
1648
                if (!title.isEmpty()) {
1649
                if (!title.isEmpty()) {
1649
                    if (FrameView* view = coreFrame->view()) {
1650
                    if (FrameView* view = coreFrame->view()) {
1650
                        GdkRectangle area = view->contentsToWindow(node->getRect());
1651
                        cairo_rectangle_int_t area = view->contentsToWindow(node->getRect());
1651
                        gtk_tooltip_set_tip_area(tooltip, &area);
1652
                        gtk_tooltip_set_tip_area(tooltip, (GdkRectangle*)&area);
1652
                    }
1653
                    }
1653
                    gtk_tooltip_set_text(tooltip, title.utf8().data());
1654
                    gtk_tooltip_set_text(tooltip, title.utf8().data());
1654
1655
Lines 1663-1670 static gboolean webkit_web_view_query_tooltip(GtkWidget *widget, gint x, gint y, a/Source/WebKit/gtk/webkit/webkitwebview.cpp_sec3
1663
    if (priv->tooltipText.length() > 0) {
1664
    if (priv->tooltipText.length() > 0) {
1664
        if (!keyboard_mode) {
1665
        if (!keyboard_mode) {
1665
            if (!priv->tooltipArea.isEmpty()) {
1666
            if (!priv->tooltipArea.isEmpty()) {
1666
                GdkRectangle area = priv->tooltipArea;
1667
                cairo_rectangle_int_t area = priv->tooltipArea;
1667
                gtk_tooltip_set_tip_area(tooltip, &area);
1668
                gtk_tooltip_set_tip_area(tooltip, (GdkRectangle*)&area);
1668
            } else
1669
            } else
1669
                gtk_tooltip_set_tip_area(tooltip, 0);
1670
                gtk_tooltip_set_tip_area(tooltip, 0);
1670
        }
1671
        }
- a/Tools/ChangeLog +14 lines
Lines 1-3 a/Tools/ChangeLog_sec1
1
2011-05-29  Joone Hur  <joone.hur@collabora.co.uk>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        [GTK] Replace GdkRectangle by cairo_rectangle_int_t
6
        https://bugs.webkit.org/show_bug.cgi?id=60687
7
8
        Replace GdkRectangle by cairo_rectangle_int_t.
9
10
        * DumpRenderTree/gtk/PixelDumpSupportGtk.cpp: Replace GdkRectangle by cairo_rectangle_int_t.
11
        (createBitmapContextFromWebView):
12
        * DumpRenderTree/gtk/TextInputController.cpp: Ditto.
13
        (firstRectForCharacterRangeCallback):
14
1
2011-05-28  Adam Barth  <abarth@webkit.org>
15
2011-05-28  Adam Barth  <abarth@webkit.org>
2
16
3
        Reviewed by Eric Seidel.
17
        Reviewed by Eric Seidel.
- a/Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp -1 / +1 lines
Lines 60-66 PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool a/Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp_sec1
60
#endif
60
#endif
61
61
62
    if (drawSelectionRect) {
62
    if (drawSelectionRect) {
63
        GdkRectangle rectangle;
63
        cairo_rectangle_int_t rectangle;
64
        DumpRenderTreeSupportGtk::rectangleForSelection(mainFrame, &rectangle);
64
        DumpRenderTreeSupportGtk::rectangleForSelection(mainFrame, &rectangle);
65
65
66
        cairo_set_line_width(context, 1.0);
66
        cairo_set_line_width(context, 1.0);
- a/Tools/DumpRenderTree/gtk/TextInputController.cpp -1 / +1 lines
Lines 113-119 static JSValueRef firstRectForCharacterRangeCallback(JSContextRef context, JSObj a/Tools/DumpRenderTree/gtk/TextInputController.cpp_sec1
113
    int length = static_cast<int>(JSValueToNumber(context, arguments[1], exception));
113
    int length = static_cast<int>(JSValueToNumber(context, arguments[1], exception));
114
    g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
114
    g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
115
115
116
    GdkRectangle rect;
116
    cairo_rectangle_int_t rect;
117
    if (!DumpRenderTreeSupportGtk::firstRectForCharacterRange(view, location, length, &rect))
117
    if (!DumpRenderTreeSupportGtk::firstRectForCharacterRange(view, location, length, &rect))
118
        return JSValueMakeUndefined(context);
118
        return JSValueMakeUndefined(context);
119
119
- a/configure.ac -1 / +1 lines
Lines 255-261 fi a/configure.ac_sec1
255
255
256
# minimum base dependencies
256
# minimum base dependencies
257
LIBSOUP_REQUIRED_VERSION=2.33.6
257
LIBSOUP_REQUIRED_VERSION=2.33.6
258
CAIRO_REQUIRED_VERSION=1.6
258
CAIRO_REQUIRED_VERSION=1.10
259
FONTCONFIG_REQUIRED_VERSION=2.4
259
FONTCONFIG_REQUIRED_VERSION=2.4
260
FREETYPE2_REQUIRED_VERSION=9.0
260
FREETYPE2_REQUIRED_VERSION=9.0
261
LIBXML_REQUIRED_VERSION=2.6
261
LIBXML_REQUIRED_VERSION=2.6

Return to Bug 60687