Changeset 261594 in webkit
- Timestamp:
- May 12, 2020 7:57:03 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r261592 r261594 1 2020-05-12 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 [CG] Change the UTI of the "WebP" image to be "org.webmproject.webp" 4 https://bugs.webkit.org/show_bug.cgi?id=211794 5 <rdar://problem/63031187> 6 7 Reviewed by Darin Adler. 8 9 See https://developers.google.com/speed/webp/docs/riff_container. 10 11 * platform/graphics/cg/UTIRegistry.cpp: 12 (WebCore::defaultSupportedImageTypes): 13 Fix review comments from bug 208038. 14 1 15 2020-05-12 Simon Fraser <simon.fraser@apple.com> 2 16 -
trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp
r258817 r261594 1 1 /* 2 * Copyright (C) 2017-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2017-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 41 41 { 42 42 static const auto defaultSupportedImageTypes = makeNeverDestroyed([] { 43 const String defaultSupportedImageTypes[]= {43 HashSet<String> defaultSupportedImageTypes = { 44 44 "com.compuserve.gif"_s, 45 45 "com.microsoft.bmp"_s, … … 56 56 "public.webp"_s, 57 57 "com.google.webp"_s, 58 "org.webmproject.webp"_s, 58 59 #endif 59 60 }; 60 61 61 RetainPtr<CFArrayRef> systemImageTypes = adoptCF(CGImageSourceCopyTypeIdentifiers());62 CFIndex count = CFArrayGetCount(system ImageTypes.get());62 auto systemSupportedCFImageTypes = adoptCF(CGImageSourceCopyTypeIdentifiers()); 63 CFIndex count = CFArrayGetCount(systemSupportedCFImageTypes.get()); 63 64 64 HashSet<String> defaultCGSupportedImageTypes; 65 for (auto& imageType : defaultSupportedImageTypes) { 66 RetainPtr<CFStringRef> string = imageType.createCFString(); 67 if (CFArrayContainsValue(systemImageTypes.get(), CFRangeMake(0, count), string.get())) 68 defaultCGSupportedImageTypes.add(imageType); 69 } 70 return defaultCGSupportedImageTypes; 65 HashSet<String> systemSupportedImageTypes; 66 CFArrayApplyFunction(systemSupportedCFImageTypes.get(), CFRangeMake(0, count), [](const void *value, void *context) { 67 String imageType = static_cast<CFStringRef>(value); 68 static_cast<HashSet<String>*>(context)->add(imageType); 69 }, &systemSupportedImageTypes); 70 71 defaultSupportedImageTypes.removeIf([&systemSupportedImageTypes](const String& imageType) { 72 return !systemSupportedImageTypes.contains(imageType); 73 }); 74 75 return defaultSupportedImageTypes; 71 76 }()); 72 77
Note: See TracChangeset
for help on using the changeset viewer.