summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/skia
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-01-06 21:36:31 +0000
committerBen Murdoch <benm@google.com>2011-01-07 10:36:05 +0000
commit4a156157940f51b91eadd76f6c86f862ec0a1da0 (patch)
treeee905fa007e14522848f571215c1054734db9269 /WebCore/platform/graphics/skia
parent21d8d81a756ca7e60b5131e5f1006f52799179b0 (diff)
downloadexternal_webkit-4a156157940f51b91eadd76f6c86f862ec0a1da0.zip
external_webkit-4a156157940f51b91eadd76f6c86f862ec0a1da0.tar.gz
external_webkit-4a156157940f51b91eadd76f6c86f862ec0a1da0.tar.bz2
Merge WebKit at Chromium 9.0.597.55: trivial merge by git
Change-Id: I2c6f2ebc4431d15ac82b5b1a9f08159e1731bc57
Diffstat (limited to 'WebCore/platform/graphics/skia')
-rw-r--r--WebCore/platform/graphics/skia/ImageSkia.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/WebCore/platform/graphics/skia/ImageSkia.cpp b/WebCore/platform/graphics/skia/ImageSkia.cpp
index fee64ca..ae2653a 100644
--- a/WebCore/platform/graphics/skia/ImageSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageSkia.cpp
@@ -143,9 +143,7 @@ static ResamplingMode computeResamplingMode(PlatformContextSkia* platformContext
// Everything else gets resampled.
// If the platform context permits high quality interpolation, use it.
- // High quality interpolation only enabled for scaling and translation.
- if (platformContext->interpolationQuality() == InterpolationHigh
- && !(platformContext->canvas()->getTotalMatrix().getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
+ if (platformContext->interpolationQuality() == InterpolationHigh)
return RESAMPLE_AWESOME;
return RESAMPLE_LINEAR;
@@ -180,17 +178,9 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
SkIRect resizedImageRect = // Represents the size of the resized image.
{ 0, 0, destRectRounded.width(), destRectRounded.height() };
- // Apply forward transform to destRect to estimate required size of
- // re-sampled bitmap, and use only in calls required to resize, or that
- // check for the required size.
- SkRect destRectTransformed;
- canvas.getTotalMatrix().mapRect(&destRectTransformed, destRect);
- SkIRect destRectTransformedRounded;
- destRectTransformed.round(&destRectTransformedRounded);
-
- if (srcIsFull && bitmap.hasResizedBitmap(destRectTransformedRounded.width(), destRectTransformedRounded.height())) {
+ if (srcIsFull && bitmap.hasResizedBitmap(destRectRounded.width(), destRectRounded.height())) {
// Yay, this bitmap frame already has a resized version.
- SkBitmap resampled = bitmap.resizedBitmap(destRectTransformedRounded.width(), destRectTransformedRounded.height());
+ SkBitmap resampled = bitmap.resizedBitmap(destRectRounded.width(), destRectRounded.height());
canvas.drawBitmapRect(resampled, 0, destRect, &paint);
return;
}
@@ -217,8 +207,8 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
destBitmapSubsetSkI.height())) {
// We're supposed to resize the entire image and cache it, even though
// we don't need all of it.
- SkBitmap resampled = bitmap.resizedBitmap(destRectTransformedRounded.width(),
- destRectTransformedRounded.height());
+ SkBitmap resampled = bitmap.resizedBitmap(destRectRounded.width(),
+ destRectRounded.height());
canvas.drawBitmapRect(resampled, 0, destRect, &paint);
} else {
// We should only resize the exposed part of the bitmap to do the
@@ -227,7 +217,7 @@ static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeIm
// Resample the needed part of the image.
SkBitmap resampled = skia::ImageOperations::Resize(subset,
skia::ImageOperations::RESIZE_LANCZOS3,
- destRectTransformedRounded.width(), destRectTransformedRounded.height(),
+ destRectRounded.width(), destRectRounded.height(),
destBitmapSubsetSkI);
// Compute where the new bitmap should be drawn. Since our new bitmap