Changeset 28345 in webkit
- Timestamp:
- Dec 3, 2007 4:57:14 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r28344 r28345 1 2007-12-03 Alp Toker <alp@atoker.com> 2 3 Reviewed by Mark Rowe. 4 5 Don't delete the decoder if it's already been created. The one we have 6 is fine. 7 8 Cairo image cleanups. Nothing substantial. 9 10 Notify ImageObservers where appropriate. 11 12 * platform/graphics/cairo/ImageCairo.cpp: 13 (WebCore::BitmapImage::draw): 14 (WebCore::Image::drawPattern): 15 * platform/graphics/cairo/ImageSourceCairo.cpp: 16 (WebCore::ImageSource::setData): 17 * platform/graphics/gtk/ImageGtk.cpp: 18 1 19 2007-12-03 Simon Hausmann <hausmann@webkit.org> 2 20 -
trunk/WebCore/platform/graphics/cairo/ImageCairo.cpp
r24016 r28345 33 33 #include "FloatRect.h" 34 34 #include "GraphicsContext.h" 35 #include "ImageObserver.h" 35 36 #include <cairo.h> 36 37 #include <math.h> … … 48 49 } 49 50 50 // ================================================51 // Image Class52 // ================================================53 54 // Drawing Routines55 56 51 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, CompositeOperator op) 57 52 { 58 cairo_t* cr = context->platformContext();59 60 53 if (!m_source.initialized()) 61 54 return; 55 56 FloatRect srcRect(src); 57 FloatRect dstRect(dst); 62 58 63 59 cairo_surface_t* image = frameAtIndex(m_currentFrame); … … 65 61 return; 66 62 63 if (mayFillWithSolidColor()) { 64 fillWithSolidColor(context, dstRect, solidColor(), op); 65 return; 66 } 67 67 68 IntSize selfSize = size(); 68 FloatRect srcRect(src);69 FloatRect dstRect(dst);70 69 70 cairo_t* cr = context->platformContext(); 71 71 cairo_save(cr); 72 72 … … 90 90 float scaleX = srcRect.width() / dstRect.width(); 91 91 float scaleY = srcRect.height() / dstRect.height(); 92 cairo_matrix_t matrix = { scaleX, 0, 0, scaleY, srcRect.x(), srcRect.y() };92 cairo_matrix_t matrix = { scaleX, 0, 0, scaleY, srcRect.x(), srcRect.y() }; 93 93 cairo_pattern_set_matrix(pattern, &matrix); 94 94 … … 96 96 cairo_translate(cr, dstRect.x(), dstRect.y()); 97 97 cairo_set_source(cr, pattern); 98 cairo_pattern_destroy(pattern); 98 99 cairo_rectangle(cr, 0, 0, dstRect.width(), dstRect.height()); 99 100 cairo_fill(cr); 100 101 101 cairo_pattern_destroy(pattern);102 102 cairo_restore(cr); 103 103 104 104 startAnimation(); 105 106 if (imageObserver()) 107 imageObserver()->didDraw(this); 105 108 } 106 109 … … 132 135 context->setCompositeOperation(op); 133 136 cairo_set_source(cr, pattern); 137 cairo_pattern_destroy(pattern); 134 138 cairo_rectangle(cr, destRect.x(), destRect.y(), destRect.width(), destRect.height()); 135 139 cairo_fill(cr); 136 140 137 cairo_pattern_destroy(pattern);138 141 context->restore(); 142 143 if (imageObserver()) 144 imageObserver()->didDraw(this); 139 145 } 140 146 -
trunk/WebCore/platform/graphics/cairo/ImageSourceCairo.cpp
r28114 r28345 113 113 // If insufficient bytes are available to determine the image type, no decoder plugin will be 114 114 // made. 115 delete m_decoder; 116 m_decoder = createDecoder(data->buffer()); 115 if (!m_decoder) 116 m_decoder = createDecoder(data->buffer()); 117 117 118 if (!m_decoder) 118 119 return; 120 119 121 m_decoder->setData(data, allDataReceived); 120 122 } -
trunk/WebCore/platform/graphics/gtk/ImageGtk.cpp
r25703 r28345 25 25 26 26 #include "config.h" 27 #include "Image.h"28 27 29 28 #include "BitmapImage.h" 29 #include "Image.h" 30 30 #include "NotImplemented.h" 31 #include <cairo.h> 32 31 33 32 // This function loads resources from WebKit 34 33 Vector<char> loadResourceIntoArray(const char*);
Note: See TracChangeset
for help on using the changeset viewer.