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

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

Issue 201513003: Implement InterpolationMedium to filter animated images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: only ode change Created 6 years, 9 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/GraphicsContextState.cpp » ('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 9f62b29a780eb6f06ee663c9839aeaec46aa7def..6abe21495fcb98ab816c019efaf7ee542d297120 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -1027,16 +1027,16 @@ void GraphicsContext::drawImage(Image* image, const IntPoint& p, CompositeOperat
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, bool useLowQualityScale)
+void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
{
if (!image)
return;
- drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation, useLowQualityScale);
+ 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, bool useLowQualityScale)
+void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
{
- drawImage(image, dest, src, op, blink::WebBlendModeNormal, shouldRespectImageOrientation, useLowQualityScale);
+ drawImage(image, dest, src, op, blink::WebBlendModeNormal, shouldRespectImageOrientation);
}
void GraphicsContext::drawImage(Image* image, const FloatRect& dest)
@@ -1046,40 +1046,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, bool useLowQualityScale)
-{ if (paintingDisabled() || !image)
+void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, WebBlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation)
+{
+ if (paintingDisabled() || !image)
return;
-
- InterpolationQuality previousInterpolationQuality = InterpolationDefault;
-
- if (useLowQualityScale) {
- previousInterpolationQuality = imageInterpolationQuality();
- setImageInterpolationQuality(InterpolationLow);
- }
-
image->draw(this, dest, src, op, blendMode, shouldRespectImageOrientation);
-
- if (useLowQualityScale)
- setImageInterpolationQuality(previousInterpolationQuality);
}
-void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, bool useLowQualityScale, WebBlendMode blendMode, const IntSize& repeatSpacing)
+void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, WebBlendMode blendMode, const IntSize& repeatSpacing)
{
if (paintingDisabled() || !image)
return;
-
- if (useLowQualityScale) {
- InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
- setImageInterpolationQuality(InterpolationLow);
- image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
- setImageInterpolationQuality(previousInterpolationQuality);
- } else {
- image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
- }
+ image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
}
void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const IntRect& srcRect,
- const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op, bool useLowQualityScale)
+ const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op)
{
if (paintingDisabled() || !image)
return;
@@ -1090,14 +1072,7 @@ void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const In
return;
}
- if (useLowQualityScale) {
- InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
- setImageInterpolationQuality(InterpolationLow);
- image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
- setImageInterpolationQuality(previousInterpolationQuality);
- } else {
- image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
- }
+ image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
}
void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& p, CompositeOperator op, WebBlendMode blendMode)
@@ -1107,11 +1082,11 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& p, Com
drawImageBuffer(image, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, blendMode);
}
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& r, CompositeOperator op, WebBlendMode blendMode, bool useLowQualityScale)
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& r, CompositeOperator op, WebBlendMode blendMode)
{
if (!image)
return;
- drawImageBuffer(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, blendMode, useLowQualityScale);
+ drawImageBuffer(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, blendMode);
}
void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, WebBlendMode blendMode)
@@ -1119,9 +1094,9 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& dest,
drawImageBuffer(image, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, blendMode);
}
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, WebBlendMode blendMode, bool useLowQualityScale)
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, WebBlendMode blendMode)
{
- drawImageBuffer(image, FloatRect(dest), FloatRect(srcRect), op, blendMode, useLowQualityScale);
+ drawImageBuffer(image, FloatRect(dest), FloatRect(srcRect), op, blendMode);
}
void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest)
@@ -1131,19 +1106,11 @@ void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest)
drawImageBuffer(image, dest, FloatRect(IntRect(IntPoint(), image->size())));
}
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, WebBlendMode blendMode, bool useLowQualityScale)
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, WebBlendMode blendMode)
{
if (paintingDisabled() || !image)
return;
-
- if (useLowQualityScale) {
- InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
- setImageInterpolationQuality(InterpolationLow);
- image->draw(this, dest, src, op, blendMode, useLowQualityScale);
- setImageInterpolationQuality(previousInterpolationQuality);
- } else {
- image->draw(this, dest, src, op, blendMode, useLowQualityScale);
- }
+ image->draw(this, dest, src, op, blendMode);
}
void GraphicsContext::writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes, int x, int y)
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | Source/platform/graphics/GraphicsContextState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698