Changeset 25105 in webkit
- Timestamp:
- Aug 15, 2007 9:34:11 PM (17 years ago)
- Location:
- trunk/WebCore/platform/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/platform/graphics/BitmapImage.h
r23733 r25105 33 33 34 34 #if PLATFORM(MAC) 35 #include <wtf/RetainPtr.h> 35 36 #ifdef __OBJC__ 36 37 @class NSImage; … … 176 177 177 178 #if PLATFORM(MAC) 178 mutable NSImage*m_nsImage; // A cached NSImage of frame 0. Only built lazily if someone actually queries for one.179 mutable CFDataRefm_tiffRep; // Cached TIFF rep for frame 0. Only built lazily if someone queries for one.179 mutable RetainPtr<NSImage> m_nsImage; // A cached NSImage of frame 0. Only built lazily if someone actually queries for one. 180 mutable RetainPtr<CFDataRef> m_tiffRep; // Cached TIFF rep for frame 0. Only built lazily if someone queries for one. 180 181 #endif 181 182 -
trunk/WebCore/platform/graphics/mac/ImageMac.mm
r24789 r25105 38 38 void BitmapImage::initPlatformData() 39 39 { 40 m_nsImage = 0;41 m_tiffRep = 0;42 40 } 43 41 … … 47 45 return; 48 46 49 if (m_nsImage) { 50 CFRelease(m_nsImage); 51 m_nsImage = 0; 52 } 53 54 if (m_tiffRep) { 55 CFRelease(m_tiffRep); 56 m_tiffRep = 0; 57 } 47 m_nsImage = 0; 48 m_tiffRep = 0; 58 49 } 59 50 … … 74 65 { 75 66 if (m_tiffRep) 76 return m_tiffRep ;67 return m_tiffRep.get(); 77 68 78 69 unsigned numFrames = frameCount(); … … 93 84 unsigned numValidFrames = images.size(); 94 85 95 CFMutableDataRef data = CFDataCreateMutable(0, 0);86 RetainPtr<CFMutableDataRef> data(AdoptCF, CFDataCreateMutable(0, 0)); 96 87 // FIXME: Use type kCGImageTypeIdentifierTIFF constant once is becomes available in the API 97 CGImageDestinationRef destination = CGImageDestinationCreateWithData(data , CFSTR("public.tiff"), numValidFrames, 0);88 CGImageDestinationRef destination = CGImageDestinationCreateWithData(data.get(), CFSTR("public.tiff"), numValidFrames, 0); 98 89 99 90 if (!destination) … … 107 98 108 99 m_tiffRep = data; 109 return m_tiffRep ;100 return m_tiffRep.get(); 110 101 } 111 102 … … 113 104 { 114 105 if (m_nsImage) 115 return m_nsImage ;106 return m_nsImage.get(); 116 107 117 108 CFDataRef data = getTIFFRepresentation(); … … 119 110 return 0; 120 111 121 m_nsImage = HardRetainWithNSRelease([[NSImage alloc] initWithData:(NSData*)data]);122 return m_nsImage ;112 m_nsImage.adoptNS([[NSImage alloc] initWithData:(NSData*)data]); 113 return m_nsImage.get(); 123 114 } 124 115
Note: See TracChangeset
for help on using the changeset viewer.