| Index: ui/gfx/image/image_skia_operations.cc
|
| ===================================================================
|
| --- ui/gfx/image/image_skia_operations.cc (revision 167659)
|
| +++ ui/gfx/image/image_skia_operations.cc (working copy)
|
| @@ -7,7 +7,6 @@
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| #include "skia/ext/image_operations.h"
|
| -#include "skia/ext/platform_canvas.h"
|
| #include "ui/base/layout.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/image/canvas_image_source.h"
|
| @@ -35,10 +34,15 @@
|
| // Creates 2x scaled image of the give |source|.
|
| ImageSkiaRep Create2XImageSkiaRep(const ImageSkiaRep& source) {
|
| gfx::Size size(source.GetWidth() * 2.0f, source.GetHeight() * 2.0f);
|
| - skia::PlatformCanvas canvas(size.width(), size.height(), false);
|
| +
|
| + SkBitmap resized_bitmap;
|
| + resized_bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(),
|
| + size.height());
|
| + if (!resized_bitmap.allocPixels())
|
| + SK_CRASH();
|
| + SkCanvas canvas(resized_bitmap);
|
| SkRect resized_bounds = RectToSkRect(gfx::Rect(size));
|
| canvas.drawBitmapRect(source.sk_bitmap(), NULL, resized_bounds);
|
| - SkBitmap resized_bitmap = canvas.getDevice()->accessBitmap(false);
|
| return ImageSkiaRep(resized_bitmap, ui::SCALE_FACTOR_200P);
|
| }
|
|
|
|
|