Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: Source/core/platform/graphics/CrossfadeGeneratedImage.cpp

Issue 22596003: Fix background blending for some cases where it did not work at all. The fix adds the blendMode par… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: adding TestExpectation lines for rebaselining Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/CrossfadeGeneratedImage.cpp
diff --git a/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp b/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp
index f6e2136927964cd65f597cbf13a37206affd8525..34451aa796d3ba7a3acff56563dac5f9d7838832 100644
--- a/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp
+++ b/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp
@@ -80,10 +80,10 @@ void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext* context)
context->endTransparencyLayer();
}
-void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode)
+void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
{
GraphicsContextStateSaver stateSaver(*context);
- context->setCompositeOperation(compositeOp);
+ context->setCompositeOperation(compositeOp, blendMode);
context->clip(dstRect);
context->translate(dstRect.x(), dstRect.y());
if (dstRect.size() != srcRect.size())
@@ -93,7 +93,7 @@ void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& ds
drawCrossfade(context);
}
-void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale, const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode)
+void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale, const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
{
OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(m_size, 1, context->isAccelerated() ? Accelerated : Unaccelerated);
if (!imageBuffer)
@@ -104,7 +104,7 @@ void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatR
drawCrossfade(graphicsContext);
// Tile the image buffer into the context.
- imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRect);
+ imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRect, blendMode);
}
}

Powered by Google App Engine
This is Rietveld 408576698