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

Unified Diff: chrome/renderer/safe_browsing/phishing_thumbnailer.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 | « chrome/renderer/chrome_render_view_observer.cc ('k') | content/plugin/webplugin_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/safe_browsing/phishing_thumbnailer.cc
===================================================================
--- chrome/renderer/safe_browsing/phishing_thumbnailer.cc (revision 167659)
+++ chrome/renderer/safe_browsing/phishing_thumbnailer.cc (working copy)
@@ -32,10 +32,12 @@
}
WebView* view = render_view->GetWebView();
base::TimeTicks beginning_time = base::TimeTicks::Now();
- skia::PlatformCanvas canvas;
- if (!canvas.initialize(view_size.width(), view_size.height(), true)) {
+ SkCanvas* canvas = skia::CreatePlatformCanvas(view_size.width(),
+ view_size.height(), true, 0,
+ skia::RETURN_NULL_ON_FAILURE);
+ if (!canvas)
return SkBitmap();
- }
+ SkAutoUnref au(canvas);
// Make sure we are not using any zoom when we take the snapshot. We will
// restore the previous zoom level after the snapshot is taken.
@@ -49,10 +51,10 @@
view->mainFrame()->setCanHaveScrollbars(false); // always hide scrollbars.
view->resize(view_size);
view->layout();
- view->paint(webkit_glue::ToWebCanvas(&canvas),
+ view->paint(webkit_glue::ToWebCanvas(canvas),
WebRect(0, 0, view_size.width(), view_size.height()));
- SkDevice* device = skia::GetTopDevice(canvas);
+ SkDevice* device = skia::GetTopDevice(*canvas);
// Now resize the thumbnail to the right size. Note: it is important that we
// use this resize algorithm here.
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | content/plugin/webplugin_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698