[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 14:24:12 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit dfe70f408b314a47e5812dd14ed326da702ebe60
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 7 21:51:14 2010 +0000
2010-10-07 Benjamin Otte <otte at gnome.org>
Reviewed by Martin Robinson.
[GTK] Code cleanup in PluginViewGtk.cpp for transparent plugins
https://bugs.webkit.org/show_bug.cgi?id=47361
Reduce some code in PluginViewGtk.cpp by doing things with Cairo instead
of directly with X11. This should work fine with GDK double-buffering, but
if we ever disable it, we'll need to verify that this is still functioning
properly.
* plugins/gtk/PluginViewGtk.cpp:
(WebCore::PluginView::paint): Do a bit of code cleanup.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d55d0de..3d57e3f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-07 Benjamin Otte <otte at gnome.org>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Code cleanup in PluginViewGtk.cpp for transparent plugins
+ https://bugs.webkit.org/show_bug.cgi?id=47361
+
+ Reduce some code in PluginViewGtk.cpp by doing things with Cairo instead
+ of directly with X11. This should work fine with GDK double-buffering, but
+ if we ever disable it, we'll need to verify that this is still functioning
+ properly.
+
+ * plugins/gtk/PluginViewGtk.cpp:
+ (WebCore::PluginView::paint): Do a bit of code cleanup.
+
2010-10-07 Anders Carlsson <andersca at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index ef09729..d0b3397 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -208,47 +208,28 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
m_windowRect.width(),
m_windowRect.height());
- if (m_isTransparent && drawableDepth != 32) {
- // Attempt to fake it when we don't have an alpha channel on our
- // pixmap. If that's not possible, at least clear the window to
- // avoid drawing artifacts.
- GtkWidget* widget = m_parentFrame->view()->hostWindow()->platformPageClient();
- GdkDrawable* gdkBackingStore = 0;
- gint xoff = 0, yoff = 0;
-
- gdk_window_get_internal_paint_info(gtk_widget_get_window(widget), &gdkBackingStore, &xoff, &yoff);
-
- GC gc = XDefaultGC(GDK_DISPLAY(), gdk_screen_get_number(gdk_screen_get_default()));
- if (gdkBackingStore) {
- XCopyArea(GDK_DISPLAY(), GDK_DRAWABLE_XID(gdkBackingStore), m_drawable, gc,
- m_windowRect.x() + exposedRect.x() - xoff,
- m_windowRect.y() + exposedRect.y() - yoff,
- exposedRect.width(), exposedRect.height(),
- exposedRect.x(), exposedRect.y());
- } else {
- // no valid backing store; clear to the background color
- XFillRectangle(GDK_DISPLAY(), m_drawable, gc,
- exposedRect.x(), exposedRect.y(),
- exposedRect.width(), exposedRect.height());
- }
- } else if (m_isTransparent) {
+ if (m_isTransparent) {
// If we have a 32 bit drawable and the plugin wants transparency,
// we'll clear the exposed area to transparent first. Otherwise,
// we'd end up with junk in there from the last paint, or, worse,
// uninitialized data.
- cairo_t* crFill = cairo_create(drawableSurface);
+ PlatformRefPtr<cairo_t> cr = adoptPlatformRef(cairo_create(drawableSurface));
- cairo_set_operator(crFill, CAIRO_OPERATOR_SOURCE);
- cairo_pattern_t* fill = cairo_pattern_create_rgba(0., 0., 0., 0.);
- cairo_set_source(crFill, fill);
+ if (!(cairo_surface_get_content(drawableSurface) & CAIRO_CONTENT_ALPHA)) {
+ // Attempt to fake it when we don't have an alpha channel on our
+ // pixmap. If that's not possible, at least clear the window to
+ // avoid drawing artifacts.
- cairo_rectangle(crFill, exposedRect.x(), exposedRect.y(),
- exposedRect.width(), exposedRect.height());
- cairo_clip(crFill);
- cairo_paint(crFill);
+ // This Would not work without double buffering, but we always use it.
+ cairo_set_source_surface(cr.get(), cairo_get_group_target(context->platformContext()),
+ -m_windowRect.x(), -m_windowRect.y());
+ cairo_set_operator(cr.get(), CAIRO_OPERATOR_SOURCE);
+ } else
+ cairo_set_operator(cr.get(), CAIRO_OPERATOR_CLEAR);
- cairo_destroy(crFill);
- cairo_pattern_destroy(fill);
+ cairo_rectangle(cr.get(), exposedRect.x(), exposedRect.y(),
+ exposedRect.width(), exposedRect.height());
+ cairo_fill(cr.get());
}
XEvent xevent;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list