Changeset 65530 in webkit
- Timestamp:
- Aug 17, 2010 12:05:02 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65529 r65530 1 2010-08-17 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by David Hyatt. 4 5 [Cairo] Remove unnecessary full-surface copies from ImageCairo and GraphicsContextCairo 6 https://bugs.webkit.org/show_bug.cgi?id=44076 7 8 No new tests as functionality has not changed. 9 10 * GNUmakefile.am: Added GRefPtrCairo to the sources list. 11 * platform/graphics/cairo/GRefPtrCairo.cpp: Added. 12 (WTF::refGPtr): Added specializations for cairo_t and cairo_surface_t. 13 (WTF::derefGPtr): 14 * platform/graphics/cairo/GRefPtrCairo.h: Added. 15 * platform/graphics/cairo/GraphicsContextCairo.cpp: 16 (WebCore::GraphicsContext::createPlatformShadow): Access the image surface directly 17 from the ImageBuffer instead of wrapping it in an Image. 18 * platform/graphics/cairo/ImageCairo.cpp: 19 (WebCore::Image::drawPattern): Create the temporary surface using cairo primitives 20 instead of through the platform-independent WebCore code. 21 1 22 2010-08-17 Martin Robinson <mrobinson@igalia.com> 2 23 -
trunk/WebCore/GNUmakefile.am
r65529 r65530 2445 2445 WebCore/platform/graphics/cairo/GOwnPtrCairo.cpp \ 2446 2446 WebCore/platform/graphics/cairo/GOwnPtrCairo.h \ 2447 WebCore/platform/graphics/cairo/GRefPtrCairo.cpp \ 2448 WebCore/platform/graphics/cairo/GRefPtrCairo.h \ 2447 2449 WebCore/platform/graphics/cairo/GradientCairo.cpp \ 2448 2450 WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp \ -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r65451 r65530 929 929 if (!kernelSize) { 930 930 setColor(cr, shadowColor); 931 RefPtr<Image> copiedImage = buffer->copyImage(); // FIXME: Copying the image is wasteful. 932 cairo_mask_surface(cr, copiedImage->nativeImageForCurrentFrame(), shadowRect.x(), shadowRect.y()); 931 cairo_mask_surface(cr, buffer->m_data.m_surface, shadowRect.x(), shadowRect.y()); 933 932 return; 934 933 } … … 950 949 // Masking makes it possible to just blur the alpha channel. 951 950 setColor(cr, shadowColor); 952 RefPtr<Image> copiedImage = blur->resultImage()->copyImage(); // FIXME: Copying the image is wasteful. 953 cairo_mask_surface(cr, copiedImage->nativeImageForCurrentFrame(), shadowRect.x(), shadowRect.y()); 951 cairo_mask_surface(cr, blur->resultImage()->m_data.m_surface, shadowRect.x(), shadowRect.y()); 954 952 #endif 955 953 } -
trunk/WebCore/platform/graphics/cairo/ImageCairo.cpp
r65454 r65530 34 34 #include "Color.h" 35 35 #include "FloatRect.h" 36 #include "GRefPtrCairo.h" 36 37 #include "GraphicsContext.h" 37 38 #include "ImageBuffer.h" … … 185 186 context->save(); 186 187 187 IntRect imageSize = enclosingIntRect(tileRect); 188 OwnPtr<ImageBuffer> imageSurface = ImageBuffer::create(imageSize.size()); 189 190 if (!imageSurface) 191 return; 192 188 GRefPtr<cairo_surface_t> clippedImageSurface = 0; 193 189 if (tileRect.size() != size()) { 194 cairo_t* clippedImageContext = imageSurface->context()->platformContext(); 195 cairo_set_source_surface(clippedImageContext, image, -tileRect.x(), -tileRect.y()); 196 cairo_paint(clippedImageContext); 197 RefPtr<Image> copiedImage = imageSurface->copyImage(); // FIXME: Copying here is wasteful. 198 image = copiedImage->nativeImageForCurrentFrame(); 190 IntRect imageSize = enclosingIntRect(tileRect); 191 clippedImageSurface = adoptGRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, imageSize.width(), imageSize.height())); 192 GRefPtr<cairo_t> clippedImageContext(cairo_create(clippedImageSurface.get())); 193 cairo_set_source_surface(clippedImageContext.get(), image, -tileRect.x(), -tileRect.y()); 194 cairo_paint(clippedImageContext.get()); 195 image = clippedImageSurface.get(); 199 196 } 200 197
Note: See TracChangeset
for help on using the changeset viewer.