Changeset 214646 in webkit
- Timestamp:
- Mar 30, 2017, 6:36:20 PM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r214643 r214646 1 2017-03-30 Megan Gardner <megan_gardner@apple.com> 2 3 Allow for extended color in snapshots 4 https://bugs.webkit.org/show_bug.cgi?id=170314 5 <rdar://problem/28676092> WKImageCreateCGImage should support WideGamut in WebKit2 on macOS 6 7 Reviewed by Simon Fraser. 8 9 Piping options through snapshots to allow for wide gamut support. 10 11 * Shared/API/c/WKImage.h: 12 * Shared/API/c/WKSharedAPICast.h: 13 (WebKit::snapshotOptionsFromImageOptions): 14 * Shared/ImageOptions.h: 15 (WebKit::snapshotOptionsToImageOptions): 16 * Shared/WebImage.cpp: 17 (WebKit::WebImage::create): 18 1 19 2017-03-30 Sam Weinig <sam@webkit.org> 2 20 -
trunk/Source/WebKit2/Shared/API/c/WKImage.h
r214297 r214646 48 48 kWKSnapshotOptionsPrinting = 1 << 6, 49 49 kWKSnapshotOptionsExcludeOverflow = 1 << 7, 50 kWKSnapshotOptionsExtendedColor = 1 << 8, 50 51 }; 51 52 typedef uint32_t WKSnapshotOptions; -
trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
r212557 r214646 932 932 snapshotOptions |= SnapshotOptionsShareable; 933 933 934 if (wkImageOptions & kWKSnapshotOptionsExtendedColor) 935 snapshotOptions |= SnapshotOptionsExtendedColor; 936 934 937 return snapshotOptions; 935 938 } -
trunk/Source/WebKit2/Shared/ImageOptions.h
r190306 r214646 31 31 enum ImageOptions { 32 32 ImageOptionsShareable = 1 << 0, 33 ImageOptionsExtendedColor = 1 << 1, 33 34 }; 34 35 … … 42 43 SnapshotOptionsForceWhiteText = 1 << 7, 43 44 SnapshotOptionsPrinting = 1 << 8, 45 SnapshotOptionsExtendedColor = 1 << 9, 44 46 }; 45 47 typedef uint32_t SnapshotOptions; … … 52 54 if (snapshotOptions & SnapshotOptionsShareable) 53 55 imageOptions |= ImageOptionsShareable; 56 57 if (snapshotOptions & SnapshotOptionsExtendedColor) 58 imageOptions |= ImageOptionsExtendedColor; 59 54 60 55 61 return static_cast<ImageOptions>(imageOptions); -
trunk/Source/WebKit2/Shared/WebImage.cpp
r210181 r214646 35 35 RefPtr<WebImage> WebImage::create(const IntSize& size, ImageOptions options) 36 36 { 37 int sharableOptions = ShareableBitmap::SupportsAlpha; 38 39 if (options & ImageOptionsExtendedColor) 40 sharableOptions |= ShareableBitmap::SupportsExtendedColor; 37 41 if (options & ImageOptionsShareable) { 38 auto bitmap = ShareableBitmap::createShareable(size, ShareableBitmap::SupportsAlpha);42 auto bitmap = ShareableBitmap::createShareable(size, sharableOptions); 39 43 if (!bitmap) 40 44 return nullptr; 41 45 return WebImage::create(bitmap.releaseNonNull()); 42 46 } 43 auto bitmap = ShareableBitmap::create(size, ShareableBitmap::SupportsAlpha);47 auto bitmap = ShareableBitmap::create(size, sharableOptions); 44 48 if (!bitmap) 45 49 return nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.