Changeset 83932 in webkit
- Timestamp:
- Apr 14, 2011 7:12:11 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83930 r83932 1 2011-04-14 Joone Hur <joone.hur@collabora.co.uk> 2 3 Reviewed by Martin Robinson. 4 5 Convert use of raw pointers to RefPtr in using Cairo 6 https://bugs.webkit.org/show_bug.cgi?id=57717 7 8 No new tests added becaue of just replacing raw pointers with smart pointers. 9 10 * platform/graphics/cairo/ContextShadowCairo.cpp: Use a RefPtr<cairo_surface_t> instead of raw pointer. 11 (WebCore::purgeScratchBuffer): 12 (WebCore::getScratchBuffer): 13 * platform/graphics/cairo/ImageBufferCairo.cpp: Use a RefPtr<cairo_t> instead of raw pointer. 14 (copySurface): 15 1 16 2011-04-14 Naoki Takano <takano.naoki@gmail.com> 2 17 -
trunk/Source/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp
r82962 r83932 43 43 namespace WebCore { 44 44 45 static cairo_surface_t* scratchBuffer = 0;45 static RefPtr<cairo_surface_t> gScratchBuffer; 46 46 static void purgeScratchBuffer() 47 47 { 48 cairo_surface_destroy(scratchBuffer); 49 scratchBuffer = 0; 48 gScratchBuffer.clear(); 50 49 } 51 50 … … 69 68 int width = size.width(); 70 69 int height = size.height(); 71 int scratchWidth = scratchBuffer ? cairo_image_surface_get_width(scratchBuffer) : 0;72 int scratchHeight = scratchBuffer ? cairo_image_surface_get_height(scratchBuffer) : 0;70 int scratchWidth = gScratchBuffer.get() ? cairo_image_surface_get_width(gScratchBuffer.get()) : 0; 71 int scratchHeight = gScratchBuffer.get() ? cairo_image_surface_get_height(gScratchBuffer.get()) : 0; 73 72 74 73 // We do not need to recreate the buffer if the current buffer is large enough. 75 if ( scratchBuffer&& scratchWidth >= width && scratchHeight >= height)76 return scratchBuffer;74 if (gScratchBuffer.get() && scratchWidth >= width && scratchHeight >= height) 75 return gScratchBuffer.get(); 77 76 78 77 purgeScratchBuffer(); … … 81 80 width = (1 + (width >> 5)) << 5; 82 81 height = (1 + (height >> 5)) << 5; 83 scratchBuffer = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);84 return scratchBuffer;82 gScratchBuffer = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height)); 83 return gScratchBuffer.get(); 85 84 } 86 85 -
trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
r83044 r83932 56 56 cairo_surface_t* newsurface = cairo_image_surface_create(format, width, height); 57 57 58 cairo_t* cr = cairo_create(newsurface); 59 cairo_set_source_surface(cr, surface, 0, 0); 60 cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); 61 cairo_paint(cr); 62 cairo_destroy(cr); 58 RefPtr<cairo_t> cr = adoptRef(cairo_create(newsurface)); 59 cairo_set_source_surface(cr.get(), surface, 0, 0); 60 cairo_set_operator(cr.get(), CAIRO_OPERATOR_SOURCE); 61 cairo_paint(cr.get()); 63 62 64 63 return newsurface;
Note: See TracChangeset
for help on using the changeset viewer.