| Index: ui/gfx/image/image_skia_operations.cc
|
| diff --git a/ui/gfx/image/image_skia_operations.cc b/ui/gfx/image/image_skia_operations.cc
|
| index 8afaf876eab4e777ab66f447b1b37bac9554ebb8..32a0cb33761b0c00932f1b5e7921d50782a896fe 100644
|
| --- a/ui/gfx/image/image_skia_operations.cc
|
| +++ b/ui/gfx/image/image_skia_operations.cc
|
| @@ -320,14 +320,17 @@ class ResizeSource : public ImageSkiaSource {
|
|
|
| // gfx::ImageSkiaSource overrides:
|
| virtual ImageSkiaRep GetImageForScale(ui::ScaleFactor scale_factor) OVERRIDE {
|
| - const ImageSkiaRep& image_rep = source_.GetRepresentation(scale_factor);
|
| - if (image_rep.GetWidth() == target_dip_size_.width() &&
|
| - image_rep.GetHeight() == target_dip_size_.height())
|
| - return image_rep;
|
| -
|
| const float scale = ui::GetScaleFactorScale(scale_factor);
|
| const Size target_pixel_size = gfx::ToFlooredSize(
|
| target_dip_size_.Scale(scale));
|
| +
|
| + const ImageSkiaRep& image_rep = source_.GetRepresentation(scale_factor);
|
| +
|
| + if (image_rep.pixel_width() == target_pixel_size.width() &&
|
| + image_rep.pixel_height() == target_pixel_size.height()) {
|
| + return ImageSkiaRep(image_rep.sk_bitmap(), scale_factor);
|
| + }
|
| +
|
| const SkBitmap resized = skia::ImageOperations::Resize(
|
| image_rep.sk_bitmap(),
|
| resize_method_,
|
| @@ -449,6 +452,14 @@ ImageSkia ImageSkiaOperations::CreateResizedImage(
|
| }
|
|
|
| // static
|
| +ImageSkia ImageSkiaOperations::CreateImageWithCustomResizeMethod(
|
| + const ImageSkia& source,
|
| + skia::ImageOperations::ResizeMethod method) {
|
| + return ImageSkia(new ResizeSource(source, method, source.size()),
|
| + source.size());
|
| +}
|
| +
|
| +// static
|
| ImageSkia ImageSkiaOperations::CreateImageWithDropShadow(
|
| const ImageSkia& source,
|
| const ShadowValues& shadows) {
|
|
|