Title: [161965] trunk
- Revision
- 161965
- Author
- [email protected]
- Date
- 2014-01-14 07:41:32 -0800 (Tue, 14 Jan 2014)
Log Message
Source/WebCore: [CSS Background Blending] Background layer with -webkit-cross-fade doesn't blend
when having -webkit-background-blending applied. Turns out the problem was
the blending parameter not being passed to WebCore::CrossfadeGeneratedImage::draw
https://bugs.webkit.org/show_bug.cgi?id=126887
Patch by Mihai Tica <[email protected]> on 2014-01-14
Reviewed by Dirk Schulze.
Test: css3/compositing/background-blend-mode-crossfade-image.html
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::draw): set blendMode on context.
LayoutTests: [CSS Background Blending] Background layer with -webkit-cross-fade doesn't blend
when having -webkit-background-blending applied.
https://bugs.webkit.org/show_bug.cgi?id=126887
Patch by Mihai Tica <[email protected]> on 2014-01-14
Reviewed by Dirk Schulze.
* css3/compositing/background-blend-mode-crossfade-image-expected.html: Added.
* css3/compositing/background-blend-mode-crossfade-image.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (161964 => 161965)
--- trunk/LayoutTests/ChangeLog 2014-01-14 15:38:26 UTC (rev 161964)
+++ trunk/LayoutTests/ChangeLog 2014-01-14 15:41:32 UTC (rev 161965)
@@ -1,5 +1,16 @@
2014-01-14 Mihai Tica <[email protected]>
+ [CSS Background Blending] Background layer with -webkit-cross-fade doesn't blend
+ when having -webkit-background-blending applied.
+
+ https://bugs.webkit.org/show_bug.cgi?id=126887
+ Reviewed by Dirk Schulze.
+
+ * css3/compositing/background-blend-mode-crossfade-image-expected.html: Added.
+ * css3/compositing/background-blend-mode-crossfade-image.html: Added.
+
+2014-01-14 Mihai Tica <[email protected]>
+
Background-blend-mode doesn't work for an element with an
SVG image as background and border-style or padding set.
https://bugs.webkit.org/show_bug.cgi?id=118894
Added: trunk/LayoutTests/css3/compositing/background-blend-mode-crossfade-image-expected.html (0 => 161965)
--- trunk/LayoutTests/css3/compositing/background-blend-mode-crossfade-image-expected.html (rev 0)
+++ trunk/LayoutTests/css3/compositing/background-blend-mode-crossfade-image-expected.html 2014-01-14 15:41:32 UTC (rev 161965)
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<style>
+ div {
+ margin: 5px;
+ width: 130px;
+ height: 130px;
+ background: url('data:image/svg+xml;utf8, \
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100"> \
+ <circle cx="50" cy="50" r="40" fill="#43C33C"/> \
+ </svg>'
+ ) no-repeat 0 0 /100% 100%, #C3C33C;
+ }
+</style>
+
+<!-- This file should contain a cross-faded image between a circle and a rectangle, on top of a yellow background color. -->
+
+<div></div>
Added: trunk/LayoutTests/css3/compositing/background-blend-mode-crossfade-image.html (0 => 161965)
--- trunk/LayoutTests/css3/compositing/background-blend-mode-crossfade-image.html (rev 0)
+++ trunk/LayoutTests/css3/compositing/background-blend-mode-crossfade-image.html 2014-01-14 15:41:32 UTC (rev 161965)
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<style>
+ div {
+ margin: 5px;
+ width: 130px;
+ height: 130px;
+ background: -webkit-cross-fade(url('data:image/svg+xml;utf8, \
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100"> \
+ <circle cx="50" cy="50" r="40" fill="#F00"/> \
+ </svg>'
+ ), url('data:image/svg+xml;utf8, \
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100"> \
+ <rect width="100" height="100" fill="#777"/> \
+ </svg>'
+ ), 50%) no-repeat 0 0 /100% 100%, #FF0;
+ -webkit-background-blend-mode: difference, normal
+ }
+</style>
+
+<!-- This file should contain a cross-faded image between a circle and a rectangle, on top of a yellow background color. -->
+
+<div></div>
Modified: trunk/Source/WebCore/ChangeLog (161964 => 161965)
--- trunk/Source/WebCore/ChangeLog 2014-01-14 15:38:26 UTC (rev 161964)
+++ trunk/Source/WebCore/ChangeLog 2014-01-14 15:41:32 UTC (rev 161965)
@@ -1,5 +1,20 @@
2014-01-14 Mihai Tica <[email protected]>
+ [CSS Background Blending] Background layer with -webkit-cross-fade doesn't blend
+ when having -webkit-background-blending applied. Turns out the problem was
+ the blending parameter not being passed to WebCore::CrossfadeGeneratedImage::draw
+
+ https://bugs.webkit.org/show_bug.cgi?id=126887
+
+ Reviewed by Dirk Schulze.
+
+ Test: css3/compositing/background-blend-mode-crossfade-image.html
+
+ * platform/graphics/CrossfadeGeneratedImage.cpp:
+ (WebCore::CrossfadeGeneratedImage::draw): set blendMode on context.
+
+2014-01-14 Mihai Tica <[email protected]>
+
Background-blend-mode doesn't work for an element with an
SVG image as background and border-style or padding set.
The problem consisted in the drawing path using the default
Modified: trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp (161964 => 161965)
--- trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp 2014-01-14 15:38:26 UTC (rev 161964)
+++ trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp 2014-01-14 15:41:32 UTC (rev 161965)
@@ -83,10 +83,10 @@
context->endTransparencyLayer();
}
-void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode, ImageOrientationDescription)
+void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
{
GraphicsContextStateSaver stateSaver(*context);
- context->setCompositeOperation(compositeOp);
+ context->setCompositeOperation(compositeOp, blendMode);
context->clip(dstRect);
context->translate(dstRect.x(), dstRect.y());
if (dstRect.size() != srcRect.size())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes