Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: ui/gfx/image/image_skia_operations.cc

Issue 11138024: Simplify platform_canvas.h by recognizing that PlatformCanvas does not actually extend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/canvas_paint_win.h ('k') | ui/surface/transport_dib.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « ui/gfx/canvas_paint_win.h ('k') | ui/surface/transport_dib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698