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

Unified Diff: Source/platform/graphics/GraphicsContext.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/GraphicsContext.h ('k') | Source/platform/graphics/Image.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.cpp
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
index 816ca6faebad9c259abab6885a9ad9330bb08c91..c5d1a02a47a1d53c913552fffefc8a82ff9d21cf 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -35,7 +35,6 @@
#include "platform/graphics/GraphicsContextClient.h"
#include "platform/graphics/ImageBuffer.h"
#include "platform/graphics/UnacceleratedImageBufferSurface.h"
-#include "platform/graphics/skia/SkiaUtils.h"
#include "platform/text/BidiResolver.h"
#include "platform/text/TextRunIterator.h"
#include "platform/weborigin/KURL.h"
@@ -439,11 +438,6 @@ CompositeOperator GraphicsContext::compositeOperationDeprecated() const
return compositeOperatorFromSkia(immutableState()->compositeOperation());
}
-WebBlendMode GraphicsContext::blendModeOperation() const
-{
- return blendModeFromSkia(immutableState()->compositeOperation());
-}
-
SkColorFilter* GraphicsContext::colorFilter() const
{
return immutableState()->colorFilter();
@@ -1073,25 +1067,20 @@ void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run,
fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor);
}
-void GraphicsContext::drawImage(Image* image, const IntPoint& p, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
+void GraphicsContext::drawImage(Image* image, const IntPoint& p, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOrientation)
{
if (!image)
return;
drawImage(image, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation);
}
-void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
+void GraphicsContext::drawImage(Image* image, const IntRect& r, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOrientation)
{
if (!image)
return;
drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation);
}
-void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
-{
- drawImage(image, dest, src, op, WebBlendModeNormal, shouldRespectImageOrientation);
-}
-
void GraphicsContext::drawImage(Image* image, const FloatRect& dest)
{
if (!image)
@@ -1099,22 +1088,22 @@ void GraphicsContext::drawImage(Image* image, const FloatRect& dest)
drawImage(image, dest, FloatRect(IntRect(IntPoint(), image->size())));
}
-void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, WebBlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation)
+void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOrientation)
{
if (contextDisabled() || !image)
return;
- image->draw(this, dest, src, op, blendMode, shouldRespectImageOrientation);
+ image->draw(this, dest, src, op, shouldRespectImageOrientation);
}
-void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, WebBlendMode blendMode, const IntSize& repeatSpacing)
+void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, SkXfermode::Mode op, const IntSize& repeatSpacing)
{
if (contextDisabled() || !image)
return;
- image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
+ image->drawTiled(this, destRect, srcPoint, tileSize, op, repeatSpacing);
}
void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const IntRect& srcRect,
- const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op)
+ const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRule, SkXfermode::Mode op)
{
if (contextDisabled() || !image)
return;
@@ -1867,8 +1856,7 @@ int GraphicsContext::preparePaintForDrawRectToRect(
SkPaint* paint,
const SkRect& srcRect,
const SkRect& destRect,
- CompositeOperator compositeOp,
- WebBlendMode blendMode,
+ SkXfermode::Mode compositeOp,
bool isBitmapWithAlpha,
bool isLazyDecoded,
bool isDataComplete) const
@@ -1895,7 +1883,7 @@ int GraphicsContext::preparePaintForDrawRectToRect(
SkRect filteredBounds;
dropShadowImageFilter()->computeFastBounds(bounds, &filteredBounds);
SkPaint layerPaint;
- layerPaint.setXfermodeMode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode));
+ layerPaint.setXfermodeMode(compositeOp);
layerPaint.setImageFilter(dropShadowImageFilter());
m_canvas->saveLayer(&filteredBounds, &layerPaint);
m_canvas->concat(ctm);
@@ -1903,7 +1891,7 @@ int GraphicsContext::preparePaintForDrawRectToRect(
}
if (!usingImageFilter) {
- paint->setXfermodeMode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode));
+ paint->setXfermodeMode(compositeOp);
paint->setLooper(this->drawLooper());
}
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/Image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698