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

Unified Diff: Source/platform/graphics/Image.cpp

Issue 868743002: Use SkXfermode::Mode in code related to Image. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to ToT Created 5 years, 11 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
« no previous file with comments | « Source/platform/graphics/Image.h ('k') | Source/platform/graphics/ImageBufferSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/Image.cpp
diff --git a/Source/platform/graphics/Image.cpp b/Source/platform/graphics/Image.cpp
index 2a125663c5874c2a1a8dc4f5860a783530c07645..368a0373f78afd8d3b3ae495b415c2ef9a31c55d 100644
--- a/Source/platform/graphics/Image.cpp
+++ b/Source/platform/graphics/Image.cpp
@@ -92,13 +92,13 @@ bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
return dataChanged(allDataReceived);
}
-void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, CompositeOperator op)
+void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, SkXfermode::Mode op)
{
if (!color.alpha())
return;
SkXfermode::Mode previousOperation = ctxt->compositeOperation();
- ctxt->setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? SkXfermode::kSrc_Mode : WebCoreCompositeToSkiaComposite(op));
+ ctxt->setCompositeOperation(!color.hasAlpha() && op == SkXfermode::kSrcOver_Mode ? SkXfermode::kSrc_Mode : op);
ctxt->fillRect(dstRect, color);
ctxt->setCompositeOperation(previousOperation);
}
@@ -117,7 +117,7 @@ FloatRect Image::adjustForNegativeSize(const FloatRect& rect)
return norm;
}
-void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, CompositeOperator op, WebBlendMode blendMode, const IntSize& repeatSpacing)
+void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, SkXfermode::Mode op, const IntSize& repeatSpacing)
{
if (mayFillWithSolidColor()) {
fillWithSolidColor(ctxt, destRect, solidColor(), op);
@@ -149,19 +149,19 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl
visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
visibleSrcRect.setWidth(destRect.width() / scale.width());
visibleSrcRect.setHeight(destRect.height() / scale.height());
- draw(ctxt, destRect, visibleSrcRect, op, blendMode, DoNotRespectImageOrientation);
+ draw(ctxt, destRect, visibleSrcRect, op, DoNotRespectImageOrientation);
return;
}
FloatRect tileRect(FloatPoint(), intrinsicTileSize);
- drawPattern(ctxt, tileRect, scale, oneTileRect.location(), op, destRect, blendMode, repeatSpacing);
+ drawPattern(ctxt, tileRect, scale, oneTileRect.location(), op, destRect, repeatSpacing);
startAnimation();
}
// FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.
void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect,
- const FloatSize& providedTileScaleFactor, TileRule hRule, TileRule vRule, CompositeOperator op)
+ const FloatSize& providedTileScaleFactor, TileRule hRule, TileRule vRule, SkXfermode::Mode op)
{
if (mayFillWithSolidColor()) {
fillWithSolidColor(ctxt, dstRect, solidColor(), op);
@@ -219,11 +219,11 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const Flo
}
void Image::drawPattern(GraphicsContext* context, const FloatRect& floatSrcRect, const FloatSize& scale,
- const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& destRect, WebBlendMode blendMode, const IntSize& repeatSpacing)
+ const FloatPoint& phase, SkXfermode::Mode op, const FloatRect& destRect, const IntSize& repeatSpacing)
{
TRACE_EVENT0("skia", "Image::drawPattern");
if (RefPtr<NativeImageSkia> bitmap = nativeImageForCurrentFrame())
- bitmap->drawPattern(context, adjustForNegativeSize(floatSrcRect), scale, phase, compositeOp, destRect, blendMode, repeatSpacing);
+ bitmap->drawPattern(context, adjustForNegativeSize(floatSrcRect), scale, phase, op, destRect, repeatSpacing);
}
void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
« no previous file with comments | « Source/platform/graphics/Image.h ('k') | Source/platform/graphics/ImageBufferSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698