Changeset 202877 in webkit
- Timestamp:
- Jul 6, 2016, 2:10:28 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202873 r202877 1 2016-07-06 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r202867. 4 https://bugs.webkit.org/show_bug.cgi?id=159491 5 6 This change caused an existing LayoutTest to crash on ios- 7 simulator (Requested by ryanhaddad on #webkit). 8 9 Reverted changeset: 10 11 "<img> with a wide gamut PDF does not display using a wide 12 gamut color space" 13 https://bugs.webkit.org/show_bug.cgi?id=158983 14 http://trac.webkit.org/changeset/202867 15 1 16 2016-07-06 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r202867 r202877 2458 2458 } 2459 2459 2460 auto maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), ColorSpaceSRGB,*c);2460 auto maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), *c); 2461 2461 if (!maskImage) 2462 2462 return; -
trunk/Source/WebCore/platform/graphics/GradientImage.cpp
r202867 r202877 76 76 77 77 if (!m_cachedImageBuffer || m_cachedGeneratorHash != generatorHash || m_cachedAdjustedSize != adjustedSize || !m_cachedImageBuffer->isCompatibleWithContext(destContext)) { 78 m_cachedImageBuffer = ImageBuffer::createCompatibleBuffer(adjustedSize, ColorSpaceSRGB, destContext);78 m_cachedImageBuffer = ImageBuffer::createCompatibleBuffer(adjustedSize, destContext, m_gradient->hasAlpha()); 79 79 if (!m_cachedImageBuffer) 80 80 return; -
trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp
r202867 r202877 165 165 #endif 166 166 167 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, ColorSpace colorSpace, const GraphicsContext& context)167 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, const GraphicsContext& context, bool hasAlpha) 168 168 { 169 169 if (size.isEmpty()) … … 172 172 IntSize scaledSize = ImageBuffer::compatibleBufferSize(size, context); 173 173 174 auto buffer = ImageBuffer::createCompatibleBuffer(scaledSize, 1, colorSpace, context);174 auto buffer = ImageBuffer::createCompatibleBuffer(scaledSize, 1, ColorSpaceSRGB, context, hasAlpha); 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 )183 std::unique_ptr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, float resolutionScale, ColorSpace colorSpace, const GraphicsContext& context, bool) 184 184 { 185 185 return create(size, context.renderingMode(), resolutionScale, colorSpace); -
trunk/Source/WebCore/platform/graphics/ImageBuffer.h
r202867 r202877 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&); 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&); 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); 86 85 87 86 static IntSize compatibleBufferSize(const FloatSize&, const GraphicsContext&); … … 174 173 // so that create() knows when it should return failure. 175 174 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 #endif179 175 }; 180 176 -
trunk/Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp
r202867 r202877 65 65 { 66 66 #if USE(NEW_THEME) 67 auto imageBuffer = ImageBuffer::createCompatibleBuffer(size(), context );67 auto imageBuffer = ImageBuffer::createCompatibleBuffer(size(), context, true); 68 68 if (!imageBuffer) 69 69 return; -
trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
r202867 r202877 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 240 235 GraphicsContext& ImageBuffer::context() const 241 236 { -
trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp
r202867 r202877 65 65 } 66 66 67 static bool surfaceMatchesParameters(IOSurface& surface, IntSize requestedSize, C GColorSpaceRefcolorSpace, IOSurface::Format format)67 static bool surfaceMatchesParameters(IOSurface& surface, IntSize requestedSize, ColorSpace 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 GColorSpaceRefcolorSpace, IOSurface::Format format)110 std::unique_ptr<IOSurface> IOSurfacePool::takeSurface(IntSize size, ColorSpace colorSpace, IOSurface::Format format) 111 111 { 112 112 CachedSurfaceMap::iterator mapIter = m_cachedSurfaces.find(size); -
trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h
r202867 r202877 29 29 #if USE(IOSURFACE) 30 30 31 #include "ColorSpace.h" 31 32 #include "IOSurface.h" 32 33 #include "IntSize.h" … … 48 49 WEBCORE_EXPORT static IOSurfacePool& sharedPool(); 49 50 50 std::unique_ptr<IOSurface> takeSurface(IntSize, C GColorSpaceRef, IOSurface::Format);51 std::unique_ptr<IOSurface> takeSurface(IntSize, ColorSpace, IOSurface::Format); 51 52 WEBCORE_EXPORT void addSurface(std::unique_ptr<IOSurface>); 52 53 -
trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
r202867 r202877 71 71 } 72 72 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) 73 ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace imageColorSpace, RenderingMode renderingMode, bool& success) 99 74 : m_logicalSize(size) 100 75 , m_resolutionScale(resolutionScale) … … 134 109 #endif 135 110 136 m_data.colorSpace = c olorSpace;111 m_data.colorSpace = cachedCGColorSpace(imageColorSpace); 137 112 138 113 RetainPtr<CGContextRef> cgContext; … … 140 115 #if USE(IOSURFACE_CANVAS_BACKING_STORE) 141 116 FloatSize userBounds = sizeForDestinationSize(FloatSize(width.unsafeGet(), height.unsafeGet())); 142 m_data.surface = IOSurface::create(m_data.backingStoreSize, IntSize(userBounds), colorSpace);117 m_data.surface = IOSurface::create(m_data.backingStoreSize, IntSize(userBounds), imageColorSpace); 143 118 cgContext = m_data.surface->ensurePlatformContext(); 144 119 if (cgContext) … … 175 150 176 151 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 {182 152 } 183 153 -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h
r202867 r202877 46 46 }; 47 47 48 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, C GColorSpaceRef, Format = Format::RGBA);49 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, IntSize contextSize, C GColorSpaceRef, Format = Format::RGBA);50 WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSendRight(const MachSendRight&, C GColorSpaceRef);51 static std::unique_ptr<IOSurface> createFromSurface(IOSurfaceRef, C GColorSpaceRef);48 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, ColorSpace, Format = Format::RGBA); 49 WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, IntSize contextSize, ColorSpace, Format = Format::RGBA); 50 WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSendRight(const MachSendRight&, ColorSpace); 51 static std::unique_ptr<IOSurface> createFromSurface(IOSurfaceRef, ColorSpace); 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 GColorSpaceRef colorSpace() const { return m_colorSpace.get(); }88 ColorSpace colorSpace() const { return m_colorSpace; } 89 89 WEBCORE_EXPORT Format format() const; 90 90 … … 101 101 102 102 private: 103 IOSurface(IntSize, C GColorSpaceRef, Format);104 IOSurface(IntSize, IntSize contextSize, C GColorSpaceRef, Format);105 IOSurface(IOSurfaceRef, C GColorSpaceRef);103 IOSurface(IntSize, ColorSpace, Format); 104 IOSurface(IntSize, IntSize contextSize, ColorSpace, Format); 105 IOSurface(IOSurfaceRef, ColorSpace); 106 106 107 static std::unique_ptr<IOSurface> surfaceFromPool(IntSize, IntSize contextSize, C GColorSpaceRef, Format);107 static std::unique_ptr<IOSurface> surfaceFromPool(IntSize, IntSize contextSize, ColorSpace, Format); 108 108 IntSize contextSize() const { return m_contextSize; } 109 109 void setContextSize(IntSize); 110 110 111 RetainPtr<CGColorSpaceRef>m_colorSpace;111 ColorSpace m_colorSpace; 112 112 IntSize m_size; 113 113 IntSize m_contextSize; -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm
r202867 r202877 46 46 using namespace WebCore; 47 47 48 inline std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, C GColorSpaceRefcolorSpace, Format pixelFormat)48 inline std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, ColorSpace 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 GColorSpaceRefcolorSpace, Format pixelFormat)58 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::create(IntSize size, ColorSpace 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 GColorSpaceRefcolorSpace, Format pixelFormat)66 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::create(IntSize size, IntSize contextSize, ColorSpace 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 GColorSpaceRefcolorSpace)73 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::createFromSendRight(const MachSendRight& sendRight, ColorSpace 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 GColorSpaceRefcolorSpace)79 std::unique_ptr<WebCore::IOSurface> WebCore::IOSurface::createFromSurface(IOSurfaceRef surface, ColorSpace 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), sRGBColorSpaceRef());92 auto surface = IOSurface::create(IntSize(width, height), ColorSpaceSRGB); 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 GColorSpaceRefcolorSpace, Format format)182 WebCore::IOSurface::IOSurface(IntSize size, ColorSpace 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 GColorSpaceRefcolorSpace, Format pixelFormat)210 WebCore::IOSurface::IOSurface(IntSize size, IntSize contextSize, ColorSpace colorSpace, Format pixelFormat) 211 211 : IOSurface(size, colorSpace, pixelFormat) 212 212 { … … 216 216 } 217 217 218 WebCore::IOSurface::IOSurface(IOSurfaceRef surface, C GColorSpaceRefcolorSpace)218 WebCore::IOSurface::IOSurface(IOSurfaceRef surface, ColorSpace 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, m_colorSpace.get(), bitmapInfo));300 m_cgContext = adoptCF(CGIOSurfaceContextCreate(m_surface.get(), m_contextSize.width(), m_contextSize.height(), bitsPerComponent, bitsPerPixel, cachedCGColorSpace(m_colorSpace), bitmapInfo)); 301 301 302 302 return m_cgContext.get(); -
trunk/Source/WebCore/platform/mac/ThemeMac.mm
r202867 r202877 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 );682 auto imageBuffer = ImageBuffer::createCompatibleBuffer(rect.size() + 2 * FloatSize(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth), deviceScaleFactor, ColorSpaceSRGB, context, false); 683 683 if (!imageBuffer) 684 684 return needsRepaint; -
trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h
r202867 r202877 189 189 CGRect* CGSNextRect(const CGSRegionEnumeratorObj); 190 190 CGError CGSReleaseRegionEnumerator(const CGSRegionEnumeratorObj); 191 CGColorSpaceRef CGContextCopyDeviceColorSpace(CGContextRef);192 191 #endif 193 192 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r202867 r202877 757 757 758 758 // Now create the mask. 759 maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), ColorSpaceSRGB,context);759 maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), context); 760 760 if (!maskImage) 761 761 return; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r202867 r202877 1145 1145 trackInfo.filler1 = 0; 1146 1146 1147 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, ColorSpaceSRGB, paintInfo.context() );1147 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, ColorSpaceSRGB, paintInfo.context(), true); 1148 1148 if (!imageBuffer) 1149 1149 return true; -
trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
r202867 r202877 352 352 // Create a new buffer and paint the foreground into it. 353 353 if (!imageBuffer) { 354 if ((imageBuffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(boundingBox.size()), ColorSpaceSRGB, m_paintInfo->context()))) {354 if ((imageBuffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(boundingBox.size()), m_paintInfo->context(), true))) { 355 355 GraphicsContext& bufferedRenderingContext = imageBuffer->context(); 356 356 bufferedRenderingContext.translate(-boundingBox.x(), -boundingBox.y()); -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r202867 r202877 220 220 imageBufferSize.scale(imageBufferScale.width(), imageBufferScale.height()); 221 221 222 std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, ColorSpaceSRGB, context );222 std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, ColorSpaceSRGB, context, true); 223 223 if (!buffer) // Failed to allocate buffer. 224 224 return; -
trunk/Source/WebKit2/ChangeLog
r202868 r202877 1 2016-07-06 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r202867. 4 https://bugs.webkit.org/show_bug.cgi?id=159491 5 6 This change caused an existing LayoutTest to crash on ios- 7 simulator (Requested by ryanhaddad on #webkit). 8 9 Reverted changeset: 10 11 "<img> with a wide gamut PDF does not display using a wide 12 gamut color space" 13 https://bugs.webkit.org/show_bug.cgi?id=158983 14 http://trac.webkit.org/changeset/202867 15 1 16 2016-07-06 Enrica Casucci <enrica@apple.com> 2 17 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
r202867 r202877 151 151 if (!decoder.decode(sendRight)) 152 152 return false; 153 result.m_frontBuffer.surface = WebCore::IOSurface::createFromSendRight(sendRight, sRGBColorSpaceRef());153 result.m_frontBuffer.surface = WebCore::IOSurface::createFromSendRight(sendRight, ColorSpaceSRGB); 154 154 return true; 155 155 } … … 211 211 212 212 if (!m_frontBuffer.surface) 213 m_frontBuffer.surface = WebCore::IOSurface::create(expandedScaledSize, sRGBColorSpaceRef(), bufferFormat(m_isOpaque));213 m_frontBuffer.surface = WebCore::IOSurface::create(expandedScaledSize, ColorSpaceSRGB, bufferFormat(m_isOpaque)); 214 214 215 215 setBufferVolatility(BufferType::Front, false); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r202867 r202877 83 83 #import "_WKSessionStateInternal.h" 84 84 #import "_WKVisitedLinkStoreInternal.h" 85 #import <WebCore/GraphicsContextCG.h>86 85 #import <WebCore/IOSurface.h> 87 86 #import <WebCore/JSDOMBinding.h> … … 1393 1392 #if USE(IOSURFACE) 1394 1393 WebCore::IOSurface::Format snapshotFormat = WebCore::screenSupportsExtendedColor() ? WebCore::IOSurface::Format::RGB10 : WebCore::IOSurface::Format::RGBA; 1395 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore:: sRGBColorSpaceRef(), snapshotFormat);1394 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::ColorSpaceSRGB, snapshotFormat); 1396 1395 CARenderServerRenderLayerWithTransform(MACH_PORT_NULL, self.layer.context.contextId, reinterpret_cast<uint64_t>(self.layer), surface->surface(), 0, 0, &transform); 1397 1396 … … 4230 4229 // If we are parented and thus won't incur a significant penalty from paging in tiles, snapshot the view hierarchy directly. 4231 4230 if (CADisplay *display = self.window.screen._display) { 4232 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore:: sRGBColorSpaceRef());4231 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::ColorSpaceSRGB); 4233 4232 CGFloat imageScaleInViewCoordinates = imageWidth / rectInViewCoordinates.size.width; 4234 4233 CATransform3D transform = CATransform3DMakeScale(imageScaleInViewCoordinates, imageScaleInViewCoordinates, 1);
Note:
See TracChangeset
for help on using the changeset viewer.