WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-164490-20161110171431.patch (text/plain), 7.04 KB, created by
Megan Gardner
on 2016-11-10 17:18:43 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2016-11-10 17:18:43 PST
Size:
7.04 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 208572) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2016-11-10 Megan Gardner <megan_gardner@apple.com> >+ >+ [Cocoa] Support wide gamut for Drag Image UI >+ https://bugs.webkit.org/show_bug.cgi?id=164490 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixed an error in the support define for wide gamut on Mac. >+ >+ The testing infrastructure to test this does not exist, and will be landing in another patch. >+ >+ * platform/graphics/cg/GraphicsContextCG.cpp: >+ (WebCore::extendedSRGBColorSpaceRef): >+ > 2016-11-10 Dean Jackson <dino@apple.com> > > Add CSS Color Level 4 to features. >Index: Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >=================================================================== >--- Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (revision 208572) >+++ Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (working copy) >@@ -97,7 +97,7 @@ CGColorSpaceRef sRGBColorSpaceRef() > CGColorSpaceRef extendedSRGBColorSpaceRef() > { > static CGColorSpaceRef extendedSRGBSpace; >-#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101200) >+#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) > extendedSRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceExtendedSRGB); > #endif > // If there is no support for exteneded sRGB, fall back to sRGB. >Index: Source/WebKit2/ChangeLog >=================================================================== >--- Source/WebKit2/ChangeLog (revision 208573) >+++ Source/WebKit2/ChangeLog (working copy) >@@ -1,3 +1,23 @@ >+2016-11-10 Megan Gardner <megan_gardner@apple.com> >+ >+ [Cocoa] Support wide gamut for Drag Image UI >+ https://bugs.webkit.org/show_bug.cgi?id=164490 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Fixed an error in the gating for the new wide gamut support in ShareableBitmap. >+ We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage. >+ Added support for wide gamut in createCGImage. >+ >+ * Shared/cg/ShareableBitmapCG.cpp: >+ (WebKit::bitmapInfo): >+ (WebKit::colorSpace): >+ (WebKit::ShareableBitmap::createGraphicsContext): >+ (WebKit::ShareableBitmap::createCGImage): >+ * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: >+ (WebKit::convertImageToBitmap): >+ (WebKit::WebDragClient::startDrag): >+ > 2016-11-10 Eric Carlson <eric.carlson@apple.com> > > [MediaStream] apply constraints passed to getUserMedia() >Index: Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp >=================================================================== >--- Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp (revision 208572) >+++ Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp (working copy) >@@ -39,7 +39,7 @@ namespace WebKit { > static CGBitmapInfo bitmapInfo(ShareableBitmap::Flags flags) > { > CGBitmapInfo info = 0; >- if ((flags & ShareableBitmap::SupportsExtendedColor) && screenSupportsExtendedColor()) { >+ if (flags & ShareableBitmap::SupportsExtendedColor) { > info |= kCGBitmapFloatComponents | kCGBitmapByteOrder16Host; > > if (flags & ShareableBitmap::SupportsAlpha) >@@ -58,18 +58,19 @@ static CGBitmapInfo bitmapInfo(Shareable > > return info; > } >+ >+static CGColorSpaceRef colorSpace(ShareableBitmap::Flags flags) >+{ >+ if (flags & ShareableBitmap::SupportsExtendedColor) >+ return extendedSRGBColorSpaceRef(); >+ return sRGBColorSpaceRef(); >+} > > std::unique_ptr<GraphicsContext> ShareableBitmap::createGraphicsContext() > { > ref(); // Balanced by deref in releaseBitmapContextData. > >- CGColorSpaceRef colorSpace; >- if (m_flags & ShareableBitmap::SupportsExtendedColor) >- colorSpace = extendedSRGBColorSpaceRef(); >- else >- colorSpace = sRGBColorSpaceRef(); >- >- 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)); >+ 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)); > > ASSERT(bitmapContext.get()); > >@@ -107,8 +108,7 @@ RetainPtr<CGImageRef> ShareableBitmap::m > RetainPtr<CGImageRef> ShareableBitmap::createCGImage(CGDataProviderRef dataProvider) const > { > ASSERT_ARG(dataProvider, dataProvider); >- // FIXME: Make this use extended color, etc. >- 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)); >+ 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)); > return image; > } > >Index: Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm >=================================================================== >--- Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (revision 208572) >+++ Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (working copy) >@@ -39,6 +39,7 @@ > #import <WebCore/FrameView.h> > #import <WebCore/GraphicsContext.h> > #import <WebCore/LegacyWebArchive.h> >+#import <WebCore/MainFrame.h> > #import <WebCore/WebCoreNSURLExtras.h> > #import <WebCore/Page.h> > #import <WebCore/RenderImage.h> >@@ -52,9 +53,12 @@ using namespace WebKit; > > namespace WebKit { > >-static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size) >+static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size, Frame& frame) > { >- auto bitmap = ShareableBitmap::createShareable(size, ShareableBitmap::SupportsAlpha); >+ ShareableBitmap::Flags flags = ShareableBitmap::SupportsAlpha; >+ if (screenSupportsExtendedColor(frame.mainFrame().view())) >+ flags |= ShareableBitmap::SupportsExtendedColor; >+ auto bitmap = ShareableBitmap::createShareable(size, flags); > if (!bitmap) > return nullptr; > >@@ -73,7 +77,7 @@ static PassRefPtr<ShareableBitmap> conve > void WebDragClient::startDrag(RetainPtr<NSImage> image, const IntPoint& point, const IntPoint&, DataTransfer&, Frame& frame, bool linkDrag) > { > IntSize bitmapSize([image size]); >- RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize); >+ RefPtr<ShareableBitmap> bitmap = convertImageToBitmap(image.get(), bitmapSize, frame); > ShareableBitmap::Handle handle; > if (!bitmap || !bitmap->createHandle(handle)) > return;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 164490
:
294093
|
294116
|
294441
| 294446