summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-22 02:41:38 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-22 02:41:38 +0000
commited77c39f4c4c540f5923124485e1c23c6de02fe8 (patch)
tree98808fb141262f8786fd64c0b60acaf4c1ab1be5 /webkit
parentbfc862e5ef4e46485beec8614251539b02725cec (diff)
downloadchromium_src-ed77c39f4c4c540f5923124485e1c23c6de02fe8.zip
chromium_src-ed77c39f4c4c540f5923124485e1c23c6de02fe8.tar.gz
chromium_src-ed77c39f4c4c540f5923124485e1c23c6de02fe8.tar.bz2
Revert r5890 (accidental commit).
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/port/platform/chromium/RenderThemeGtk.cpp38
-rw-r--r--webkit/port/platform/graphics/skia/GdkSkia.cc5
2 files changed, 20 insertions, 23 deletions
diff --git a/webkit/port/platform/chromium/RenderThemeGtk.cpp b/webkit/port/platform/chromium/RenderThemeGtk.cpp
index 98af73c..e05e9c5 100644
--- a/webkit/port/platform/chromium/RenderThemeGtk.cpp
+++ b/webkit/port/platform/chromium/RenderThemeGtk.cpp
@@ -159,33 +159,35 @@ static bool paintMozWidget(RenderTheme* theme, GtkThemeWidgetType type, RenderOb
break;
}
- PlatformContextSkia* pcs = i.context->platformContext();
- SkCanvas* canvas = pcs->canvas();
- if (!canvas)
- return false;
+ AffineTransform ctm = i.context->getCTM();
+ IntPoint pos = ctm.mapPoint(rect.location());
GdkRectangle gdkRect;
- gdkRect.x = rect.x();
- gdkRect.y = rect.y();
+ gdkRect.x = pos.x();
+ gdkRect.y = pos.y();
gdkRect.width = rect.width();
gdkRect.height = rect.height();
+ GtkTextDirection direction = gtkTextDirection(o->style()->direction());
+
+ PlatformContextSkia* pcs = i.context->platformContext();
+ SkCanvas* canvas = pcs->canvas();
+ if (!canvas)
+ return false;
- // getTotalClip returns the currently set clip region in device coordinates,
- // so we have to apply the current transform (actually we only support translations)
- // to get the page coordinates that our gtk widget rendering expects.
- // We invert it because we want to map from device coordinates to page coordinates.
const SkIRect clip_region = canvas->getTotalClip().getBounds();
- AffineTransform ctm = i.context->getCTM().inverse();
- IntPoint pos = ctm.mapPoint(IntPoint(SkScalarRound(clip_region.fLeft), SkScalarRound(clip_region.fTop)));
+
GdkRectangle gdkClipRect;
- gdkClipRect.x = pos.x();
- gdkClipRect.y = pos.y();
- gdkClipRect.width = SkScalarRound(clip_region.width());
- gdkClipRect.height = SkScalarRound(clip_region.height());
+ gdkClipRect.x = clip_region.fLeft;
+ gdkClipRect.y = clip_region.fTop;
+ gdkClipRect.width = clip_region.width();
+ gdkClipRect.height = clip_region.height();
- GtkTextDirection direction = gtkTextDirection(o->style()->direction());
+ gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect);
+
+ const gint r =
+ moz_gtk_widget_paint(type, pcs->gdk_skia(), &gdkRect, &gdkClipRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
- return moz_gtk_widget_paint(type, pcs->gdk_skia(), &gdkRect, &gdkClipRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
+ return r;
}
static void setButtonPadding(RenderStyle* style)
diff --git a/webkit/port/platform/graphics/skia/GdkSkia.cc b/webkit/port/platform/graphics/skia/GdkSkia.cc
index 8613192..4774aaf 100644
--- a/webkit/port/platform/graphics/skia/GdkSkia.cc
+++ b/webkit/port/platform/graphics/skia/GdkSkia.cc
@@ -465,11 +465,6 @@ gdk_skia_ref_cairo_surface(GdkDrawable *drawable) {
CAIRO_FORMAT_ARGB32, dev->width(), dev->height(), bm->rowBytes());
}
- SkMatrix matrix = skia->canvas->getTotalMatrix();
- int x_shift = SkScalarRound(matrix.getTranslateX());
- int y_shift = SkScalarRound(matrix.getTranslateY());
-
- cairo_surface_set_device_offset(skia->surface, x_shift, y_shift);
return cairo_surface_reference(skia->surface);
}