Changeset 202867 in webkit
- Timestamp:
- Jul 6, 2016 11:46:51 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202863 r202867 1 2016-07-06 Antoine Quint <graouts@apple.com> 2 3 <img> with a wide gamut PDF does not display using a wide gamut color space 4 https://bugs.webkit.org/show_bug.cgi?id=158983 5 <rdar://problem/25720247> 6 7 Reviewed by Tim Horton. 8 9 Calls to ImageBuffer::createCompatibleBuffer() that do not provide an explicit 10 color space will now infer the color space from the provided graphics context 11 on platforms using CG. The method signature that takes in a GraphicsContext 12 without a color space is now split into a CG-specified implementation and a 13 Cairo one to avoid having diverging platform code in ImageBuffer.cpp. 14 15 Some call sites need to provide an explicit color space still, so we add a new 16 ImageBuffer::createCompatibleBuffer() that allows for that while inferring 17 sizing and scaling from a GraphicsContext. 18 19 All signatures of ImageBuffer::createCompatibleBuffer() are losing the 20 hasAlpha parameter which was always ignored. All call sites that were using 21 hasAlpha have been updated. 22 23 In addition, we make all the IOSurface and IOSurfacePool code, which is 24 CG-specific, use the plaform-specific type CGColorSpaceRef instead of ColorSpace 25 so that we may pick up on the color space copied over from the graphics context 26 in the CG-specific implementation of ImageBuffer::createCompatibleBuffer(). 27 28 * html/canvas/CanvasRenderingContext2D.cpp: 29 (WebCore::CanvasRenderingContext2D::drawTextInternal): 30 * platform/graphics/GradientImage.cpp: 31 (WebCore::GradientImage::drawPattern): 32 * platform/graphics/ImageBuffer.cpp: 33 (WebCore::ImageBuffer::createCompatibleBuffer): 34 * platform/graphics/ImageBuffer.h: 35 * platform/graphics/NamedImageGeneratedImage.cpp: 36 (WebCore::NamedImageGeneratedImage::drawPattern): 37 * platform/graphics/cairo/ImageBufferCairo.cpp: 38 (WebCore::ImageBuffer::createCompatibleBuffer): 39 * platform/graphics/cg/IOSurfacePool.cpp: 40 (WebCore::surfaceMatchesParameters): 41 (WebCore::IOSurfacePool::takeSurface): 42 * platform/graphics/cg/IOSurfacePool.h: 43 * platform/graphics/cg/ImageBufferCG.cpp: 44 (WebCore::ImageBuffer::createCompatibleBuffer): 45 (WebCore::ImageBuffer::ImageBuffer): 46 * platform/graphics/cocoa/IOSurface.h: 47 * platform/graphics/cocoa/IOSurface.mm: 48 (WebCore::IOSurface::surfaceFromPool): 49 (WebCore::IOSurface::create): 50 (WebCore::IOSurface::createFromSendRight): 51 (WebCore::IOSurface::createFromSurface): 52 (WebCore::IOSurface::createFromImage): 53 (WebCore::IOSurface::IOSurface): 54 (WebCore::IOSurface::ensurePlatformContext): 55 * platform/mac/ThemeMac.mm: 56 (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext): 57 * platform/spi/cg/CoreGraphicsSPI.h: 58 * rendering/RenderBoxModelObject.cpp: 59 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 60 * rendering/RenderThemeMac.mm: 61 (WebCore::RenderThemeMac::paintProgressBar): 62 * rendering/svg/SVGRenderingContext.cpp: 63 (WebCore::SVGRenderingContext::bufferForeground): 64 * svg/graphics/SVGImage.cpp: 65 (WebCore::SVGImage::drawPatternForContainer): 66 1 67 2016-07-06 Tim Horton <timothy_horton@apple.com> 2 68 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r202712 r202867 2458 2458 } 2459 2459 2460 auto maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), *c);2460 auto maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), ColorSpaceSRGB, *c); 2461 2461 if (!maskImage) 2462 2462 return; -
trunk/Source/WebCore/platform/graphics/GradientImage.cpp
r201629 r202867 76 76 77 77 if (!m_cachedImageBuffer || m_cachedGeneratorHash != generatorHash || m_cachedAdjustedSize != adjustedSize || !m_cachedImageBuffer->isCompatibleWithContext(destContext)) { 78 m_cachedImageBuffer = ImageBuffer::createCompatibleBuffer(adjustedSize, destContext, m_gradient->hasAlpha());78 m_cachedImageBuffer = ImageBuffer::createCompatibleBuffer(adjustedSize, ColorSpaceSRGB, destContext); 79 79 if (!m_cachedImageBuffer) 80 80 return; -
trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp
r202394 r202867 165 165 #endif 166 166 167 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, const GraphicsContext& context, bool hasAlpha)167 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, ColorSpace colorSpace, const GraphicsContext& context) 168 168 { 169 169 if (size.isEmpty()) … … 172 172 IntSize scaledSize = ImageBuffer::compatibleBufferSize(size, context); 173 173 174 auto buffer = ImageBuffer::createCompatibleBuffer(scaledSize, 1, ColorSpaceSRGB, context, hasAlpha);174 auto buffer = ImageBuffer::createCompatibleBuffer(scaledSize, 1, colorSpace, context); 175 175 if (!buffer) 176 176 return nullptr; … … 181 181 } 182 182 183 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, float resolutionScale, ColorSpace colorSpace, const GraphicsContext& context , bool)183 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, float resolutionScale, ColorSpace colorSpace, const GraphicsContext& context) 184 184 { 185 185 return create(size, context.renderingMode(), resolutionScale, colorSpace); -
trunk/Source/WebCore/platform/graphics/ImageBuffer.h
r202394 r202867 81 81 82 82 // Create an image buffer compatible with the context, with suitable resolution for drawing into the buffer and then into this context. 83 static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, const GraphicsContext&, bool hasAlpha = true); 84 static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, ColorSpace, const GraphicsContext&, bool hasAlpha); 83 static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, const GraphicsContext&); 84 static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, ColorSpace, const GraphicsContext&); 85 static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, ColorSpace, const GraphicsContext&); 85 86 86 87 static IntSize compatibleBufferSize(const FloatSize&, const GraphicsContext&); … … 173 174 // so that create() knows when it should return failure. 174 175 WEBCORE_EXPORT ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, bool& success); 176 #if USE(CG) 177 ImageBuffer(const FloatSize&, float resolutionScale, CGColorSpaceRef, RenderingMode, bool& success); 178 #endif 175 179 }; 176 180 -
trunk/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp
r201629 r202867 65 65 { 66 66 #if USE(NEW_THEME) 67 auto imageBuffer = ImageBuffer::createCompatibleBuffer(size(), context , true);67 auto imageBuffer = ImageBuffer::createCompatibleBuffer(size(), context); 68 68 if (!imageBuffer) 69 69 return; -
trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
r202484 r202867 233 233 } 234 234 235 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, const GraphicsContext& context) 236 { 237 return createCompatibleBuffer(size, ColorSpaceSRGB, context); 238 } 239 235 240 GraphicsContext& ImageBuffer::context() const 236 241 { -
trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp
r201255 r202867 65 65 } 66 66 67 static bool surfaceMatchesParameters(IOSurface& surface, IntSize requestedSize, C olorSpacecolorSpace, IOSurface::Format format)67 static bool surfaceMatchesParameters(IOSurface& surface, IntSize requestedSize, CGColorSpaceRef colorSpace, IOSurface::Format format) 68 68 { 69 69 if (format != surface.format()) … … 108 108 } 109 109 110 std::unique_ptr<IOSurface> IOSurfacePool::takeSurface(IntSize size, C olorSpacecolorSpace, IOSurface::Format format)110 std::unique_ptr<IOSurface> IOSurfacePool::takeSurface(IntSize size, CGColorSpaceRef colorSpace, IOSurface::Format format) 111 111 { 112 112 CachedSurfaceMap::iterator mapIter = m_cachedSurfaces.find(size); -
trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h
r192709 r202867 29 29 #if USE(IOSURFACE) 30 30 31 #include "ColorSpace.h"32 31 #include "IOSurface.h" 33 32 #include "IntSize.h" … … 49 48 WEBCORE_EXPORT static IOSurfacePool& sharedPool(); 50 49 51 std::unique_ptr<IOSurface> takeSurface(IntSize, C olorSpace, IOSurface::Format);50 std::unique_ptr<IOSurface> takeSurface(IntSize, CGColorSpaceRef, IOSurface::Format); 52 51 WEBCORE_EXPORT void addSurface(std::unique_ptr<IOSurface>); 53 52 -
trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
r202394 r202867 71 71 } 72 72 73 ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace imageColorSpace, RenderingMode renderingMode, bool& success) 73 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, const GraphicsContext& context) 74 { 75 if (size.isEmpty()) 76 return nullptr; 77 78 IntSize scaledSize = ImageBuffer::compatibleBufferSize(size, context); 79 float resolutionScale = context.scaleFactor().width(); 80 RetainPtr<CGColorSpaceRef> colorSpace; 81 #if PLATFORM(COCOA) 82 colorSpace = adoptCF(CGContextCopyDeviceColorSpace(context.platformContext())); 83 #else 84 colorSpace = sRGBColorSpaceRef(); 85 #endif 86 RenderingMode renderingMode = context.renderingMode(); 87 bool success = false; 88 std::unique_ptr<ImageBuffer> buffer(new ImageBuffer(scaledSize, resolutionScale, colorSpace.get(), renderingMode, success)); 89 90 if (!success) 91 return nullptr; 92 93 // Set up a corresponding scale factor on the graphics context. 94 buffer->context().scale(FloatSize(scaledSize.width() / size.width(), scaledSize.height() / size.height())); 95 return buffer; 96 } 97 98 ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, CGColorSpaceRef colorSpace, RenderingMode renderingMode, bool& success) 74 99 : m_logicalSize(size) 75 100 , m_resolutionScale(resolutionScale) … … 109 134 #endif 110 135 111 m_data.colorSpace = c achedCGColorSpace(imageColorSpace);136 m_data.colorSpace = colorSpace; 112 137 113 138 RetainPtr<CGContextRef> cgContext; … … 115 140 #if USE(IOSURFACE_CANVAS_BACKING_STORE) 116 141 FloatSize userBounds = sizeForDestinationSize(FloatSize(width.unsafeGet(), height.unsafeGet())); 117 m_data.surface = IOSurface::create(m_data.backingStoreSize, IntSize(userBounds), imageColorSpace);142 m_data.surface = IOSurface::create(m_data.backingStoreSize, IntSize(userBounds), colorSpace); 118 143 cgContext = m_data.surface->ensurePlatformContext(); 119 144 if (cgContext) … … 150 175 151 176 success = true; 177 } 178 179 ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace imageColorSpace, RenderingMode renderingMode, bool& success) 180 : ImageBuffer(size, resolutionScale, cachedCGColorSpace(imageColorSpace), renderingMode, success) 181 { 152 182 } 153 183 -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h
r202394 r202867 46 46 }; 47 47 48 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, C olorSpace, Format = Format::RGBA);49 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, IntSize contextSize, C olorSpace, Format = Format::RGBA);50 WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSendRight(const MachSendRight&, C olorSpace);51 static std::unique_ptr<IOSurface> createFromSurface(IOSurfaceRef, C olorSpace);48 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, CGColorSpaceRef, Format = Format::RGBA); 49 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, IntSize contextSize, CGColorSpaceRef, Format = Format::RGBA); 50 WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSendRight(const MachSendRight&, CGColorSpaceRef); 51 static std::unique_ptr<IOSurface> createFromSurface(IOSurfaceRef, CGColorSpaceRef); 52 52 WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromImage(CGImageRef); 53 53 … … 86 86 IntSize size() const { return m_size; } 87 87 size_t totalBytes() const { return m_totalBytes; } 88 C olorSpace colorSpace() const { return m_colorSpace; }88 CGColorSpaceRef colorSpace() const { return m_colorSpace.get(); } 89 89 WEBCORE_EXPORT Format format() const; 90 90 … … 101 101 102 102 private: 103 IOSurface(IntSize, C olorSpace, Format);104 IOSurface(IntSize, IntSize contextSize, C olorSpace, Format);105 IOSurface(IOSurfaceRef, C olorSpace);103 IOSurface(IntSize, CGColorSpaceRef, Format); 104 IOSurface(IntSize, IntSize contextSize, CGColorSpaceRef, Format); 105 IOSurface(IOSurfaceRef, CGColorSpaceRef); 106 106 107 static std::unique_ptr<IOSurface> surfaceFromPool(IntSize, IntSize contextSize, C olorSpace, Format);107 static std::unique_ptr<IOSurface> surfaceFromPool(IntSize, IntSize contextSize, CGColorSpaceRef, Format); 108 108 IntSize contextSize() const { return m_contextSize; } 109 109 void setContextSize(IntSize); 110 110 111 ColorSpacem_colorSpace;111 RetainPtr<CGColorSpaceRef> m_colorSpace; 112 112 IntSize m_size; 113 113 IntSize m_contextSize; -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm
r202142 r202867 46 46 using namespace WebCore; 47 47 48 inline std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, C olorSpacecolorSpace, Format pixelFormat)48 inline std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpace, Format pixelFormat) 49 49 { 50 50 auto cachedSurface = IOSurfacePool::sharedPool().takeSurface(size, colorSpace, pixelFormat); … … 56 56 } 57 57 58 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::create(IntSize size, C olorSpacecolorSpace, Format pixelFormat)58 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::create(IntSize size, CGColorSpaceRef colorSpace, Format pixelFormat) 59 59 { 60 60 if (auto cachedSurface = surfaceFromPool(size, size, colorSpace, pixelFormat)) … … 64 64 } 65 65 66 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::create(IntSize size, IntSize contextSize, C olorSpacecolorSpace, Format pixelFormat)66 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::create(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpace, Format pixelFormat) 67 67 { 68 68 if (auto cachedSurface = surfaceFromPool(size, contextSize, colorSpace, pixelFormat)) … … 71 71 } 72 72 73 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::createFromSendRight(const MachSendRight& sendRight, C olorSpacecolorSpace)73 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::createFromSendRight(const MachSendRight& sendRight, CGColorSpaceRef colorSpace) 74 74 { 75 75 auto surface = adoptCF(IOSurfaceLookupFromMachPort(sendRight.sendRight())); … … 77 77 } 78 78 79 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::createFromSurface(IOSurfaceRef surface, C olorSpacecolorSpace)79 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::createFromSurface(IOSurfaceRef surface, CGColorSpaceRef colorSpace) 80 80 { 81 81 return std::unique_ptr<IOSurface>(new IOSurface(surface, colorSpace)); … … 90 90 size_t height = CGImageGetHeight(image); 91 91 92 auto surface = IOSurface::create(IntSize(width, height), ColorSpaceSRGB);92 auto surface = IOSurface::create(IntSize(width, height), sRGBColorSpaceRef()); 93 93 auto surfaceContext = surface->ensurePlatformContext(); 94 94 CGContextDrawImage(surfaceContext, CGRectMake(0, 0, width, height), image); … … 180 180 } 181 181 182 WebCore::IOSurface::IOSurface(IntSize size, C olorSpacecolorSpace, Format format)182 WebCore::IOSurface::IOSurface(IntSize size, CGColorSpaceRef colorSpace, Format format) 183 183 : m_colorSpace(colorSpace) 184 184 , m_size(size) … … 208 208 } 209 209 210 WebCore::IOSurface::IOSurface(IntSize size, IntSize contextSize, C olorSpacecolorSpace, Format pixelFormat)210 WebCore::IOSurface::IOSurface(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpace, Format pixelFormat) 211 211 : IOSurface(size, colorSpace, pixelFormat) 212 212 { … … 216 216 } 217 217 218 WebCore::IOSurface::IOSurface(IOSurfaceRef surface, C olorSpacecolorSpace)218 WebCore::IOSurface::IOSurface(IOSurfaceRef surface, CGColorSpaceRef colorSpace) 219 219 : m_colorSpace(colorSpace) 220 220 , m_surface(surface) … … 298 298 } 299 299 300 m_cgContext = adoptCF(CGIOSurfaceContextCreate(m_surface.get(), m_contextSize.width(), m_contextSize.height(), bitsPerComponent, bitsPerPixel, cachedCGColorSpace(m_colorSpace), bitmapInfo));300 m_cgContext = adoptCF(CGIOSurfaceContextCreate(m_surface.get(), m_contextSize.width(), m_contextSize.height(), bitsPerComponent, bitsPerPixel, m_colorSpace.get(), bitmapInfo)); 301 301 302 302 return m_cgContext.get(); -
trunk/Source/WebCore/platform/mac/ThemeMac.mm
r201038 r202867 680 680 if (useImageBuffer) { 681 681 NSRect imageBufferDrawRect = NSRect(FloatRect(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth, rect.width(), rect.height())); 682 auto imageBuffer = ImageBuffer::createCompatibleBuffer(rect.size() + 2 * FloatSize(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth), deviceScaleFactor, ColorSpaceSRGB, context , false);682 auto imageBuffer = ImageBuffer::createCompatibleBuffer(rect.size() + 2 * FloatSize(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth), deviceScaleFactor, ColorSpaceSRGB, context); 683 683 if (!imageBuffer) 684 684 return needsRepaint; -
trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h
r201572 r202867 189 189 CGRect* CGSNextRect(const CGSRegionEnumeratorObj); 190 190 CGError CGSReleaseRegionEnumerator(const CGSRegionEnumeratorObj); 191 CGColorSpaceRef CGContextCopyDeviceColorSpace(CGContextRef); 191 192 #endif 192 193 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r201868 r202867 757 757 758 758 // Now create the mask. 759 maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), context);759 maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), ColorSpaceSRGB, context); 760 760 if (!maskImage) 761 761 return; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r202274 r202867 1145 1145 trackInfo.filler1 = 0; 1146 1146 1147 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, ColorSpaceSRGB, paintInfo.context() , true);1147 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, ColorSpaceSRGB, paintInfo.context()); 1148 1148 if (!imageBuffer) 1149 1149 return true; -
trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
r201629 r202867 352 352 // Create a new buffer and paint the foreground into it. 353 353 if (!imageBuffer) { 354 if ((imageBuffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(boundingBox.size()), m_paintInfo->context(), true))) {354 if ((imageBuffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(boundingBox.size()), ColorSpaceSRGB, m_paintInfo->context()))) { 355 355 GraphicsContext& bufferedRenderingContext = imageBuffer->context(); 356 356 bufferedRenderingContext.translate(-boundingBox.x(), -boundingBox.y()); -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r202005 r202867 220 220 imageBufferSize.scale(imageBufferScale.width(), imageBufferScale.height()); 221 221 222 std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, ColorSpaceSRGB, context , true);222 std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, ColorSpaceSRGB, context); 223 223 if (!buffer) // Failed to allocate buffer. 224 224 return; -
trunk/Source/WebKit2/ChangeLog
r202858 r202867 1 2016-07-06 Antoine Quint <graouts@apple.com> 2 3 <img> with a wide gamut PDF does not display using a wide gamut color space 4 https://bugs.webkit.org/show_bug.cgi?id=158983 5 <rdar://problem/25720247> 6 7 Reviewed by Tim Horton. 8 9 ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface. 10 11 * Shared/mac/RemoteLayerBackingStore.mm: 12 (WebKit::RemoteLayerBackingStore::decode): 13 (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): 14 * UIProcess/API/Cocoa/WKWebView.mm: 15 (-[WKWebView _takeViewSnapshot]): 16 (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 17 1 18 2016-07-06 Commit Queue <commit-queue@webkit.org> 2 19 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
r202229 r202867 151 151 if (!decoder.decode(sendRight)) 152 152 return false; 153 result.m_frontBuffer.surface = WebCore::IOSurface::createFromSendRight(sendRight, ColorSpaceSRGB);153 result.m_frontBuffer.surface = WebCore::IOSurface::createFromSendRight(sendRight, sRGBColorSpaceRef()); 154 154 return true; 155 155 } … … 211 211 212 212 if (!m_frontBuffer.surface) 213 m_frontBuffer.surface = WebCore::IOSurface::create(expandedScaledSize, ColorSpaceSRGB, bufferFormat(m_isOpaque));213 m_frontBuffer.surface = WebCore::IOSurface::create(expandedScaledSize, sRGBColorSpaceRef(), bufferFormat(m_isOpaque)); 214 214 215 215 setBufferVolatility(BufferType::Front, false); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r202695 r202867 83 83 #import "_WKSessionStateInternal.h" 84 84 #import "_WKVisitedLinkStoreInternal.h" 85 #import <WebCore/GraphicsContextCG.h> 85 86 #import <WebCore/IOSurface.h> 86 87 #import <WebCore/JSDOMBinding.h> … … 1392 1393 #if USE(IOSURFACE) 1393 1394 WebCore::IOSurface::Format snapshotFormat = WebCore::screenSupportsExtendedColor() ? WebCore::IOSurface::Format::RGB10 : WebCore::IOSurface::Format::RGBA; 1394 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore:: ColorSpaceSRGB, snapshotFormat);1395 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat); 1395 1396 CARenderServerRenderLayerWithTransform(MACH_PORT_NULL, self.layer.context.contextId, reinterpret_cast<uint64_t>(self.layer), surface->surface(), 0, 0, &transform); 1396 1397 … … 4229 4230 // If we are parented and thus won't incur a significant penalty from paging in tiles, snapshot the view hierarchy directly. 4230 4231 if (CADisplay *display = self.window.screen._display) { 4231 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore:: ColorSpaceSRGB);4232 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::sRGBColorSpaceRef()); 4232 4233 CGFloat imageScaleInViewCoordinates = imageWidth / rectInViewCoordinates.size.width; 4233 4234 CATransform3D transform = CATransform3DMakeScale(imageScaleInViewCoordinates, imageScaleInViewCoordinates, 1);
Note: See TracChangeset
for help on using the changeset viewer.