summaryrefslogtreecommitdiffstats
path: root/webkit/port/platform
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 16:16:35 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 16:16:35 +0000
commitc4b347b36152d693f2914f13c3b6f83f16a6d9b8 (patch)
tree9ef3b6ea138959fb4f59f97a791c0c4c4efebecd /webkit/port/platform
parentf3750b3846cc639d75046be16826ff1cf109d76e (diff)
downloadchromium_src-c4b347b36152d693f2914f13c3b6f83f16a6d9b8.zip
chromium_src-c4b347b36152d693f2914f13c3b6f83f16a6d9b8.tar.gz
chromium_src-c4b347b36152d693f2914f13c3b6f83f16a6d9b8.tar.bz2
Reverting 6709,6708,6706.
Review URL: http://codereview.chromium.org/13345 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port/platform')
-rw-r--r--webkit/port/platform/graphics/ImageSkia.cpp28
-rw-r--r--webkit/port/platform/graphics/NativeImageSkia.cpp4
2 files changed, 18 insertions, 14 deletions
diff --git a/webkit/port/platform/graphics/ImageSkia.cpp b/webkit/port/platform/graphics/ImageSkia.cpp
index 2b8ce61..4936502 100644
--- a/webkit/port/platform/graphics/ImageSkia.cpp
+++ b/webkit/port/platform/graphics/ImageSkia.cpp
@@ -211,21 +211,25 @@ void drawResampledBitmap(SkCanvas& canvas,
} else {
// We should only resize the exposed part of the bitmap to do the
// minimal possible work.
+ gfx::Rect destBitmapSubset(destBitmapSubsetSkI.fLeft,
+ destBitmapSubsetSkI.fTop,
+ destBitmapSubsetSkI.width(),
+ destBitmapSubsetSkI.height());
// Resample the needed part of the image.
- SkBitmap resampled = skia::ImageOperations::Resize(subset,
- skia::ImageOperations::RESIZE_LANCZOS3,
- destRectRounded.width(), destRectRounded.height(),
- destBitmapSubsetSkI);
+ SkBitmap resampled = gfx::ImageOperations::Resize(subset,
+ gfx::ImageOperations::RESIZE_LANCZOS3,
+ gfx::Size(destRectRounded.width(), destRectRounded.height()),
+ destBitmapSubset);
// Compute where the new bitmap should be drawn. Since our new bitmap
// may be smaller than the original, we have to shift it over by the
// same amount that we cut off the top and left.
SkRect offsetDestRect = {
- destBitmapSubsetSkI.fLeft + destRect.fLeft,
- destBitmapSubsetSkI.fTop + destRect.fTop,
- destBitmapSubsetSkI.fRight + destRect.fLeft,
- destBitmapSubsetSkI.fBottom + destRect.fTop };
+ destBitmapSubset.x() + destRect.fLeft,
+ destBitmapSubset.y() + destRect.fTop,
+ destBitmapSubset.right() + destRect.fLeft,
+ destBitmapSubset.bottom() + destRect.fTop };
canvas.drawBitmapRect(resampled, 0, offsetDestRect, &paint);
}
@@ -346,10 +350,10 @@ void Image::drawPattern(GraphicsContext* context,
if (resampling == RESAMPLE_AWESOME) {
// Do nice resampling.
- SkBitmap resampled = skia::ImageOperations::Resize(src_subset,
- skia::ImageOperations::RESIZE_LANCZOS3,
- static_cast<int>(dest_bitmap_width),
- static_cast<int>(dest_bitmap_height));
+ SkBitmap resampled = gfx::ImageOperations::Resize(src_subset,
+ gfx::ImageOperations::RESIZE_LANCZOS3,
+ gfx::Size(static_cast<int>(dest_bitmap_width),
+ static_cast<int>(dest_bitmap_height)));
shader = SkShader::CreateBitmapShader(
resampled, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode);
diff --git a/webkit/port/platform/graphics/NativeImageSkia.cpp b/webkit/port/platform/graphics/NativeImageSkia.cpp
index fa4ce86..72bbcc4 100644
--- a/webkit/port/platform/graphics/NativeImageSkia.cpp
+++ b/webkit/port/platform/graphics/NativeImageSkia.cpp
@@ -61,8 +61,8 @@ bool NativeImageSkia::hasResizedBitmap(int w, int h) const {
SkBitmap NativeImageSkia::resizedBitmap(int w, int h) const {
if (m_resizedImage.width() != w || m_resizedImage.height() != h) {
- m_resizedImage = skia::ImageOperations::Resize(*this,
- skia::ImageOperations::RESIZE_LANCZOS3, w, h);
+ m_resizedImage = gfx::ImageOperations::Resize(*this,
+ gfx::ImageOperations::RESIZE_LANCZOS3, gfx::Size(w, h));
}
return m_resizedImage;
}