Changeset 31224 in webkit
- Timestamp:
- Mar 21, 2008 5:39:07 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r31213 r31224 1 2008-03-21 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 Enable tests for <rdar://problem/5788451> 6 toDataURL not implemented for Windows (need mapping of MIME type to UTI) 7 8 * platform/win/Skipped: 9 * platform/win/fast/canvas: Added. 10 * platform/win/fast/canvas/toDataURL-supportedTypes-expected.txt: Added. 11 1 12 2008-03-21 Dan Bernstein <mitz@apple.com> 2 13 -
trunk/LayoutTests/platform/win/Skipped
r30899 r31224 326 326 svg/custom/acid3-test-77.html 327 327 328 # <rdar://problem/5788451> toDataURL broke Windows build329 fast/canvas/toDataURL-noData.html330 fast/canvas/toDataURL-supportedTypes.html331 332 328 ################################################################################ 333 329 ####################### No bugs filed about the below yet####################### -
trunk/WebCore/ChangeLog
r31223 r31224 1 2008-03-21 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Oliver Hunt. 4 5 Fix <rdar://problem/5788451> 6 toDataURL not implemented for Windows (need mapping of MIME type to UTI) 7 8 Hard code support for just PNG's on windows, the minimum the spec requires. 9 10 * platform/MIMETypeRegistry.cpp: 11 (WebCore::initializeSupportedImageMIMETypesForEncoding): 12 * platform/graphics/cg/ImageBufferCG.cpp: 13 (WebCore::utiFromMIMEType): 14 (WebCore::ImageBuffer::toDataURL): 15 1 16 2008-03-21 Matt Lilek <webkit@mattlilek.com> 2 17 -
trunk/WebCore/platform/MIMETypeRegistry.cpp
r30906 r31224 125 125 126 126 #if PLATFORM(CG) 127 #if PLATFORM(MAC) 127 128 RetainPtr<CFArrayRef> supportedTypes(AdoptCF, CGImageDestinationCopyTypeIdentifiers()); 128 129 CFIndex count = CFArrayGetCount(supportedTypes.get()); … … 133 134 supportedImageMIMETypesForEncoding->add(mimeType); 134 135 } 136 #else 137 // FIXME: Add Windows support for all the supported UTI's when a way to convert from MIMEType to UTI reliably is found. 138 // For now, only support PNG, the minimum that the spec requires. 139 supportedImageMIMETypesForEncoding->add("image/png"); 140 #endif 135 141 #elif PLATFORM(QT) 136 142 QList<QByteArray> formats = QImageWriter::supportedImageFormats(); -
trunk/WebCore/platform/graphics/cg/ImageBufferCG.cpp
r30901 r31224 216 216 } 217 217 218 static CFStringRef utiFromMIMEType(const String& mimeType) 219 { 220 #if PLATFORM(MAC) 221 return UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType.createCFString(), 0); 222 #else 223 // FIXME: Add Windows support for all the supported UTI's when a way to convert from MIMEType to UTI reliably is found. 224 // For now, only support PNG, the minimum that the spec requires. 225 ASSERT(equalIgnoringCase(mimeType, "image/png")); 226 static const CFStringRef kUTTypePNG = CFSTR("public.png"); 227 return kUTTypePNG; 228 #endif 229 } 230 218 231 String ImageBuffer::toDataURL(const String& mimeType) const 219 232 { 220 #if PLATFORM(MAC)221 233 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 222 234 … … 251 263 return String("data:,"); 252 264 253 RetainPtr<CFStringRef> imageUTI(AdoptCF, UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType.createCFString(), 0));265 RetainPtr<CFStringRef> imageUTI(AdoptCF, utiFromMIMEType(mimeType)); 254 266 RetainPtr<CGImageDestinationRef> imageDestination(AdoptCF, CGImageDestinationCreateWithData(transformedImageData.get(), imageUTI.get(), 1, 0)); 255 267 if (!imageDestination) … … 267 279 268 280 return String::format("data:%s;base64,%s", mimeType.utf8().data(), out.data()); 269 #else270 return String();271 #endif272 281 } 273 282
Note: See TracChangeset
for help on using the changeset viewer.