Pass the right color space over to the web process so we can set it on our CA context
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 00:29:34 +0000 (00:29 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Jun 2012 00:29:34 +0000 (00:29 +0000)
commit02c079d0f181f3e72bdc411c8df9d17f6528aa05
tree752f97a728fe280d710b9ccf5be9e545869b0869
parentd1b544d266d22a69c83c2292db2233149576062a
Pass the right color space over to the web process so we can set it on our CA context
https://bugs.webkit.org/show_bug.cgi?id=88819
<rdar://problem/11629050>

Reviewed by John Sullivan.

Source/WebKit2:

* Platform/mac/LayerHostingContext.h:
(LayerHostingContext):
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForPort):
(WebKit::LayerHostingContext::createForWindowServer):
Use a single constructor and explicitly set up the parameters of the constructed object.

(WebKit::LayerHostingContext::setColorSpace):
(WebKit::LayerHostingContext::colorSpace):
Add getter and setter.

* Scripts/webkit2/messages.py:
(struct_or_class):
WebKit::ColorSpaceData is a struct.

* Shared/WebPageCreationParameters.cpp:
Encode and decode the color space parameter.

* Shared/WebPageCreationParameters.h:
Add the color space.

* Shared/mac/ColorSpaceData.h: Added.
* Shared/mac/ColorSpaceData.mm: Added.
Add a new class that represents a color space that can be sent over the wire.

* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::colorSpace):
Call through to the WKView.

* UIProcess/API/mac/WKView.mm:
(-[WKView _windowDidChangeBackingProperties:]):
Fix whitespace.

(-[WKView viewDidChangeBackingProperties]):
Check if our new color space is different from the current one and null the current one out if that is the case,
it will be reinitialized by the next call to -[WKView _colorSpace].

(-[WKView _colorSpace:]):
Compute the color space. If we're not in a window we'll get the main screen's color space.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::colorSpaceDidChange):
Add empty stub.

* UIProcess/PageClient.h:
Add colorSpace getter.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
Initialize the color space.

* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
Send the new color space over to the web process.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::colorSpace):
Call through to the page client.

* WebKit2.xcodeproj/project.pbxproj:
Add ColorSpaceData.h and ColorSpaceData.mm.

* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
Add SetColorSpace message.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
Set the color space from the creation parameters.

(WebKit::TiledCoreAnimationDrawingArea::setColorSpace):
Set the color space on the layer hosting context.

(WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext):
Make sure we apply the color space from the previous layer hosting context if one exists.

WebKitLibraries:

Add WKCAContextSetColorSpace and WKCAContextGetColorSpace.

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceSnowLeopard.a:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/mac/LayerHostingContext.h
Source/WebKit2/Platform/mac/LayerHostingContext.mm
Source/WebKit2/Scripts/webkit2/messages.py
Source/WebKit2/Shared/WebPageCreationParameters.cpp
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/Shared/mac/ColorSpaceData.h [new file with mode: 0644]
Source/WebKit2/Shared/mac/ColorSpaceData.mm [new file with mode: 0644]
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a