[Windows] Optionally invert colors when drawing to a WebView's backing store.
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 20:01:39 +0000 (20:01 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 20:01:39 +0000 (20:01 +0000)
commitf80d5dae7a3780e4e665e74a880e9e1816204b45
treea5814398270e31c942b2826700f74e4742fe127c
parent5d6eeee5a36fcc80ae7e4942c3195c2822ac50a2
[Windows] Optionally invert colors when drawing to a WebView's backing store.
https://bugs.webkit.org/show_bug.cgi?id=77168

Reviewed by Sam Weinig.

Source/WebCore:

* css/CSSPrimitiveValueMappings.h: Assert that CompositeDifference is
not converted to a CSS value. Exposing a new compositing operation to
CSS is outside the scope of this patch.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* platform/graphics/GraphicsTypes.h: Add CompositeDifference as a
CompositeOperator. Also, remove an outdated comment.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::setPlatformCompositeOperation): Map
CompositeDifference to kCGBlendModeDifference.

Source/WebKit/win:

* WebView.cpp:
(WebView::WebView): Initialize m_shouldInvertColors to false.
(WebView::paintIntoBackingStore): If m_shouldInvertColors is true, draw
an opaque white quad using the CompositeDifference blend mode. This
blend operation instructs CoreGraphics to take the difference between
the source pixel (white) and the background pixel, resulting in an
inverted pixel.
* WebView.h: Define m_shouldInvertColors.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/platform/graphics/GraphicsTypes.h
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h