Changeset 208596 in webkit
- Timestamp:
- Nov 11, 2016 10:54:21 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r208595 r208596 1 2016-11-11 Megan Gardner <megan_gardner@apple.com> 2 3 [Cocoa] Support wide gamut for Drag Image UI 4 https://bugs.webkit.org/show_bug.cgi?id=164490 5 6 Reviewed by Tim Horton. 7 8 Fixed an error in the support define for wide gamut on Mac. 9 10 The testing infrastructure to test this does not exist, and will be landing in another patch. 11 12 * platform/graphics/cg/GraphicsContextCG.cpp: 13 (WebCore::extendedSRGBColorSpaceRef): 14 1 15 2016-11-11 Beth Dakin <bdakin@apple.com> 2 16 -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r208460 r208596 98 98 { 99 99 static CGColorSpaceRef extendedSRGBSpace; 100 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101200)100 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) 101 101 extendedSRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceExtendedSRGB); 102 102 #endif -
trunk/Source/WebKit2/ChangeLog
r208595 r208596 1 2016-11-11 Megan Gardner <megan_gardner@apple.com> 2 3 [Cocoa] Support wide gamut for Drag Image UI 4 https://bugs.webkit.org/show_bug.cgi?id=164490 5 6 Reviewed by Tim Horton. 7 8 Fixed an error in the gating for the new wide gamut support in ShareableBitmap. 9 We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage. 10 Added support for wide gamut in createCGImage. 11 12 * Shared/cg/ShareableBitmapCG.cpp: 13 (WebKit::bitmapInfo): 14 (WebKit::colorSpace): 15 (WebKit::ShareableBitmap::createGraphicsContext): 16 (WebKit::ShareableBitmap::createCGImage): 17 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: 18 (WebKit::convertImageToBitmap): 19 (WebKit::WebDragClient::startDrag): 20 1 21 2016-11-11 Beth Dakin <bdakin@apple.com> 2 22 -
trunk/Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp
r208020 r208596 40 40 { 41 41 CGBitmapInfo info = 0; 42 if ( (flags & ShareableBitmap::SupportsExtendedColor) && screenSupportsExtendedColor()) {42 if (flags & ShareableBitmap::SupportsExtendedColor) { 43 43 info |= kCGBitmapFloatComponents | kCGBitmapByteOrder16Host; 44 44 … … 59 59 return info; 60 60 } 61 62 static CGColorSpaceRef colorSpace(ShareableBitmap::Flags flags) 63 { 64 if (flags & ShareableBitmap::SupportsExtendedColor) 65 return extendedSRGBColorSpaceRef(); 66 return sRGBColorSpaceRef(); 67 } 61 68 62 69 std::unique_ptr<GraphicsContext> ShareableBitmap::createGraphicsContext() … … 64 71 ref(); // Balanced by deref in releaseBitmapContextData. 65 72 66 CGColorSpaceRef colorSpace; 67 if (m_flags & ShareableBitmap::SupportsExtendedColor) 68 colorSpace = extendedSRGBColorSpaceRef(); 69 else 70 colorSpace = sRGBColorSpaceRef(); 71 72 RetainPtr<CGContextRef> bitmapContext = adoptCF(CGBitmapContextCreateWithData(data(), m_size.width(), m_size.height(), m_bytesPerPixel * 8 / 4, m_size.width() * m_bytesPerPixel, colorSpace, bitmapInfo(m_flags), releaseBitmapContextData, this)); 73 RetainPtr<CGContextRef> bitmapContext = adoptCF(CGBitmapContextCreateWithData(data(), m_size.width(), m_size.height(), m_bytesPerPixel * 8 / 4, m_size.width() * m_bytesPerPixel, colorSpace(m_flags), bitmapInfo(m_flags), releaseBitmapContextData, this)); 73 74 74 75 ASSERT(bitmapContext.get()); … … 108 109 { 109 110 ASSERT_ARG(dataProvider, dataProvider); 110 // FIXME: Make this use extended color, etc. 111 RetainPtr<CGImageRef> image = adoptCF(CGImageCreate(m_size.width(), m_size.height(), 8, 32, m_size.width() * 4, sRGBColorSpaceRef(), bitmapInfo(m_flags), dataProvider, 0, false, kCGRenderingIntentDefault)); 111 RetainPtr<CGImageRef> image = adoptCF(CGImageCreate(m_size.width(), m_size.height(), m_bytesPerPixel * 8 / 4, m_bytesPerPixel * 8, m_size.width() * m_bytesPerPixel, colorSpace(m_flags), bitmapInfo(m_flags), dataProvider, 0, false, kCGRenderingIntentDefault)); 112 112 return image; 113 113 } -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
r208455 r208596 40 40 #import <WebCore/GraphicsContext.h> 41 41 #import <WebCore/LegacyWebArchive.h> 42 #import <WebCore/MainFrame.h> 42 43 #import <WebCore/WebCoreNSURLExtras.h> 43 44 #import <WebCore/Page.h> … … 53 54 namespace WebKit { 54 55 55 static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size )56 static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size, Frame& frame) 56 57 { 57 auto bitmap = ShareableBitmap::createShareable(size, ShareableBitmap::SupportsAlpha); 58 ShareableBitmap::Flags flags = ShareableBitmap::SupportsAlpha; 59 if (screenSupportsExtendedColor(frame.mainFrame().view())) 60 flags |= ShareableBitmap::SupportsExtendedColor; 61 auto bitmap = ShareableBitmap::createShareable(size, flags); 58 62 if (!bitmap) 59 63 return nullptr; … … 74 78 { 75 79 IntSize bitmapSize([image size]); 76 RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize );80 RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize, frame); 77 81 ShareableBitmap::Handle handle; 78 82 if (!bitmap || !bitmap->createHandle(handle))
Note: See TracChangeset
for help on using the changeset viewer.