[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
alex at webkit.org
alex at webkit.org
Wed Dec 22 13:22:59 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2a5781bd6ce1043527a054651beada43d90e72f4
Author: alex at webkit.org <alex at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 13 19:05:53 2010 +0000
2010-09-13 Alejandro G. Castro <alex at igalia.com>
Reviewed by Kenneth Rohde Christiansen.
[Gtk] Reduce the size of the shadow buffer in the paths using the clip region
https://bugs.webkit.org/show_bug.cgi?id=44699
Intersect the clip bounding rect with the path that we are going
to use to create the shadow in order to reduce the region we have
to blur.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::drawPathShadow):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9e13d0a..8f9cb5d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-13 Alejandro G. Castro <alex at igalia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Gtk] Reduce the size of the shadow buffer in the paths using the clip region
+ https://bugs.webkit.org/show_bug.cgi?id=44699
+
+ Intersect the clip bounding rect with the path that we are going
+ to use to create the shadow in order to reduce the region we have
+ to blur.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::drawPathShadow):
+
210-09-13 Darin Fisher <darin at chromium.org>
Reviewed by David Levin.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 276465b..d6cc96a 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -214,13 +214,29 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva
float radius = 0;
GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur);
+ cairo_clip_extents(cr, &x0, &y0, &x1, &y1);
+ FloatRect clipRect(x0, y0, x1 - x0, y1 - y0);
+
+ FloatPoint rectLocation = shadowRect.location();
+
+ // Reduce the shadow rect using the clip area.
+ if (!clipRect.contains(shadowRect)) {
+ shadowRect.intersect(clipRect);
+ if (shadowRect.isEmpty())
+ return;
+ shadowRect.inflate(radius);
+ shadowBufferSize = IntSize(shadowRect.width(), shadowRect.height());
+ }
+
+ shadowOffset = rectLocation - shadowRect.location();
+
// Create suitably-sized ImageBuffer to hold the shadow.
OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize);
// Draw shadow into a new ImageBuffer.
cairo_t* shadowContext = shadowBuffer->context()->platformContext();
copyContextProperties(cr, shadowContext);
- cairo_translate(shadowContext, -rect.x() + radius, -rect.y() + radius);
+ cairo_translate(shadowContext, -rect.x() + radius + shadowOffset.width(), -rect.y() + radius + shadowOffset.height());
cairo_new_path(shadowContext);
OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
cairo_append_path(shadowContext, path.get());
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list