Title: [174041] trunk/Source/WebCore
- Revision
- 174041
- Author
- [email protected]
- Date
- 2014-09-28 01:06:08 -0700 (Sun, 28 Sep 2014)
Log Message
[cairo] GraphicsContext should not depend on GTK+
https://bugs.webkit.org/show_bug.cgi?id=137175
Reviewed by Martin Robinson.
Remove the unused methods depending on GDK and simplify
GraphicsContext::drawFocusRing() using only cairo API.
* PlatformGTK.cmake: Move GraphicsContextCairo.cpp to the webcore sources.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawFocusRing): Iterate the rectangles
instead of creating a region for the rectangles and call gdk_cairo_region().
(WebCore::GraphicsContext::setGdkExposeEvent): Deleted.
(WebCore::GraphicsContext::gdkExposeEvent): Deleted.
(WebCore::GraphicsContext::gdkWindow): Deleted.
* platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (174040 => 174041)
--- trunk/Source/WebCore/ChangeLog 2014-09-28 05:57:48 UTC (rev 174040)
+++ trunk/Source/WebCore/ChangeLog 2014-09-28 08:06:08 UTC (rev 174041)
@@ -1,3 +1,24 @@
+2014-09-28 Carlos Garcia Campos <[email protected]>
+
+ [cairo] GraphicsContext should not depend on GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=137175
+
+ Reviewed by Martin Robinson.
+
+ Remove the unused methods depending on GDK and simplify
+ GraphicsContext::drawFocusRing() using only cairo API.
+
+ * PlatformGTK.cmake: Move GraphicsContextCairo.cpp to the webcore sources.
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::drawFocusRing): Iterate the rectangles
+ instead of creating a region for the rectangles and call gdk_cairo_region().
+ (WebCore::GraphicsContext::setGdkExposeEvent): Deleted.
+ (WebCore::GraphicsContext::gdkExposeEvent): Deleted.
+ (WebCore::GraphicsContext::gdkWindow): Deleted.
+ * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
+ (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
+
2014-09-27 Chris Dumez <[email protected]>
HTMLPlugInElement::isUserObservable() is causing layout
Modified: trunk/Source/WebCore/PlatformGTK.cmake (174040 => 174041)
--- trunk/Source/WebCore/PlatformGTK.cmake 2014-09-28 05:57:48 UTC (rev 174040)
+++ trunk/Source/WebCore/PlatformGTK.cmake 2014-09-28 08:06:08 UTC (rev 174041)
@@ -54,6 +54,7 @@
platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
platform/graphics/cairo/GradientCairo.cpp
platform/graphics/cairo/GraphicsContext3DCairo.cpp
+ platform/graphics/cairo/GraphicsContextCairo.cpp
platform/graphics/cairo/ImageBufferCairo.cpp
platform/graphics/cairo/ImageCairo.cpp
platform/graphics/cairo/IntRectCairo.cpp
@@ -191,8 +192,6 @@
platform/graphics/GLContext.cpp
- platform/graphics/cairo/GraphicsContextCairo.cpp
-
platform/graphics/egl/GLContextEGL.cpp
platform/graphics/freetype/FontPlatformDataFreeType.cpp
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (174040 => 174041)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2014-09-28 05:57:48 UTC (rev 174040)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2014-09-28 08:06:08 UTC (rev 174041)
@@ -535,12 +535,6 @@
GraphicsContext(cairo_t*);
#endif
-#if PLATFORM(GTK)
- void setGdkExposeEvent(GdkEventExpose*);
- GdkWindow* gdkWindow() const;
- GdkEventExpose* gdkExposeEvent() const;
-#endif
-
static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle);
private:
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (174040 => 174041)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2014-09-28 05:57:48 UTC (rev 174040)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2014-09-28 08:06:08 UTC (rev 174041)
@@ -58,9 +58,7 @@
#include <stdio.h>
#include <wtf/MathExtras.h>
-#if PLATFORM(GTK)
-#include <gdk/gdk.h>
-#elif PLATFORM(WIN)
+#if PLATFORM(WIN)
#include <cairo-win32.h>
#endif
@@ -557,36 +555,16 @@
if (paintingDisabled())
return;
- unsigned rectCount = rects.size();
-
cairo_t* cr = platformContext()->cr();
cairo_save(cr);
cairo_push_group(cr);
cairo_new_path(cr);
#if PLATFORM(GTK)
-#ifdef GTK_API_VERSION_2
- GdkRegion* reg = gdk_region_new();
+ for (const auto& rect : rects)
+ cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
#else
- cairo_region_t* reg = cairo_region_create();
-#endif
-
- for (unsigned i = 0; i < rectCount; i++) {
-#ifdef GTK_API_VERSION_2
- GdkRectangle rect = rects[i];
- gdk_region_union_with_rect(reg, &rect);
-#else
- cairo_rectangle_int_t rect = rects[i];
- cairo_region_union_rectangle(reg, &rect);
-#endif
- }
- gdk_cairo_region(cr, reg);
-#ifdef GTK_API_VERSION_2
- gdk_region_destroy(reg);
-#else
- cairo_region_destroy(reg);
-#endif
-#else
+ unsigned rectCount = rects.size();
int radius = (width - 1) / 2;
Path path;
for (unsigned i = 0; i < rectCount; ++i) {
@@ -1086,26 +1064,6 @@
cairo_restore(cr);
}
-#if PLATFORM(GTK)
-void GraphicsContext::setGdkExposeEvent(GdkEventExpose* expose)
-{
- m_data->expose = expose;
-}
-
-GdkEventExpose* GraphicsContext::gdkExposeEvent() const
-{
- return m_data->expose;
-}
-
-GdkWindow* GraphicsContext::gdkWindow() const
-{
- if (!m_data->expose)
- return 0;
-
- return m_data->expose->window;
-}
-#endif
-
void GraphicsContext::setPlatformShouldAntialias(bool enable)
{
if (paintingDisabled())
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h (174040 => 174041)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h 2014-09-28 05:57:48 UTC (rev 174040)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h 2014-09-28 08:06:08 UTC (rev 174041)
@@ -36,10 +36,7 @@
#include <math.h>
#include <stdio.h>
-#if PLATFORM(GTK)
-#include <pango/pango.h>
-typedef struct _GdkExposeEvent GdkExposeEvent;
-#elif PLATFORM(WIN)
+#if PLATFORM(WIN)
#include <cairo-win32.h>
#endif
@@ -49,9 +46,6 @@
public:
GraphicsContextPlatformPrivate(PlatformContextCairo* newPlatformContext)
: platformContext(newPlatformContext)
-#if PLATFORM(GTK)
- , expose(0)
-#endif
#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS))
// NOTE: These may note be needed: review and remove once Cairo implementation is complete
, m_hdc(0)
@@ -95,9 +89,6 @@
PlatformContextCairo* platformContext;
Vector<float> layers;
-#if PLATFORM(GTK)
- GdkEventExpose* expose;
-#endif
#if PLATFORM(WIN) || (PLATFORM(GTK) && OS(WINDOWS))
HDC m_hdc;
bool m_shouldIncludeChildWindows;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes