diff options
Diffstat (limited to 'webkit/port/platform/graphics/ImageSkia.cpp')
-rw-r--r-- | webkit/port/platform/graphics/ImageSkia.cpp | 28 |
1 files changed, 16 insertions, 12 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); |