Chromium Code Reviews| Index: Source/platform/graphics/StaticBitmapImage.cpp |
| diff --git a/Source/platform/graphics/StaticBitmapImage.cpp b/Source/platform/graphics/StaticBitmapImage.cpp |
| index 52b88e9fe2d976f63d0409e00fd457f47a8e1609..fe7974793d887adaf6bc95e818a2064a894c266f 100644 |
| --- a/Source/platform/graphics/StaticBitmapImage.cpp |
| +++ b/Source/platform/graphics/StaticBitmapImage.cpp |
| @@ -36,7 +36,7 @@ bool StaticBitmapImage::currentFrameKnownToBeOpaque() |
| return m_image->isOpaque(); |
| } |
| -void StaticBitmapImage::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, SkXfermode::Mode compositeOp, RespectImageOrientationEnum) |
| +void StaticBitmapImage::draw(SkCanvas* canvas, const SkPaint& paint, const FloatRect& dstRect, const FloatRect& srcRect, RespectImageOrientationEnum, const ImageFilterQualityHelper* filterHelper) |
| { |
| FloatRect normDstRect = adjustForNegativeSize(dstRect); |
|
Stephen White
2015/05/27 15:46:02
This may be redundant with computations done up in
Justin Novosad
2015/05/27 20:08:16
Yep. I tried it in a debug build and there are no
|
| FloatRect normSrcRect = adjustForNegativeSize(srcRect); |
| @@ -48,18 +48,13 @@ void StaticBitmapImage::draw(GraphicsContext* ctx, const FloatRect& dstRect, con |
| ASSERT(normSrcRect.width() <= m_image->width() && normSrcRect.height() <= m_image->height()); |
| - { |
| - SkCanvas* canvas = ctx->canvas(); |
| - |
| - SkPaint paint; |
| - int initialSaveCount = ctx->preparePaintForDrawRectToRect(&paint, srcRect, dstRect, compositeOp, !currentFrameKnownToBeOpaque()); |
| - |
| - SkRect srcSkRect = WebCoreFloatRectToSKRect(normSrcRect); |
| - SkRect dstSkRect = WebCoreFloatRectToSKRect(normDstRect); |
| - |
| - canvas->drawImageRect(m_image.get(), &srcSkRect, dstSkRect, &paint); |
| - canvas->restoreToCount(initialSaveCount); |
| - } |
| + SkRect srcSkRect = WebCoreFloatRectToSKRect(normSrcRect); |
| + SkRect dstSkRect = WebCoreFloatRectToSKRect(normDstRect); |
| + SkPaint imagePaint(paint); |
| + imagePaint.setFilterQuality(filterHelper->computeFilterQuality(this, normDstRect, normSrcRect)); |
| + imagePaint.setAntiAlias(filterHelper->shouldDrawAntiAliased(normDstRect)); |
| + // TODO: Add support for filterHelper->shouldClampToSourceRect() |
| + canvas->drawImageRect(m_image.get(), &srcSkRect, dstSkRect, &imagePaint); |
| if (ImageObserver* observer = imageObserver()) |
| observer->didDraw(this); |