Changeset 67402 in webkit
- Timestamp:
- Sep 13, 2010 12:05:53 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r67401 r67402 1 2010-09-13 Alejandro G. Castro <alex@igalia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Gtk] Reduce the size of the shadow buffer in the paths using the clip region 6 https://bugs.webkit.org/show_bug.cgi?id=44699 7 8 Intersect the clip bounding rect with the path that we are going 9 to use to create the shadow in order to reduce the region we have 10 to blur. 11 12 * platform/graphics/cairo/GraphicsContextCairo.cpp: 13 (WebCore::drawPathShadow): 14 1 15 210-09-13 Darin Fisher <darin@chromium.org> 2 16 -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r67398 r67402 215 215 GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur); 216 216 217 cairo_clip_extents(cr, &x0, &y0, &x1, &y1); 218 FloatRect clipRect(x0, y0, x1 - x0, y1 - y0); 219 220 FloatPoint rectLocation = shadowRect.location(); 221 222 // Reduce the shadow rect using the clip area. 223 if (!clipRect.contains(shadowRect)) { 224 shadowRect.intersect(clipRect); 225 if (shadowRect.isEmpty()) 226 return; 227 shadowRect.inflate(radius); 228 shadowBufferSize = IntSize(shadowRect.width(), shadowRect.height()); 229 } 230 231 shadowOffset = rectLocation - shadowRect.location(); 232 217 233 // Create suitably-sized ImageBuffer to hold the shadow. 218 234 OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize); … … 221 237 cairo_t* shadowContext = shadowBuffer->context()->platformContext(); 222 238 copyContextProperties(cr, shadowContext); 223 cairo_translate(shadowContext, -rect.x() + radius , -rect.y() + radius);239 cairo_translate(shadowContext, -rect.x() + radius + shadowOffset.width(), -rect.y() + radius + shadowOffset.height()); 224 240 cairo_new_path(shadowContext); 225 241 OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
Note: See TracChangeset
for help on using the changeset viewer.