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

Unified Diff: chrome/common/badge_util.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months 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/browser/ui/views/toolbar_view.cc ('k') | chrome/common/extensions/extension_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/badge_util.cc
===================================================================
--- chrome/common/badge_util.cc (revision 82144)
+++ chrome/common/badge_util.cc (working copy)
@@ -83,8 +83,8 @@
badge_width--;
// Render the badge bitmap and overlay into a canvas.
- scoped_ptr<gfx::CanvasSkia> canvas(
- new gfx::CanvasSkia(badge_width, icon.height(), false));
+ scoped_ptr<gfx::CanvasSkia> canvas(new gfx::CanvasSkia);
+ canvas->Init(badge_width, icon.height(), false);
canvas->DrawBitmapInt(icon, 0, 0);
// Draw the text overlay centered horizontally and vertically. Skia expects
@@ -92,7 +92,8 @@
// add 'font_size - 1' to the height.
SkScalar x = (badge_width - text_width)/2;
SkScalar y = (icon.height() - font_size)/2 + font_size - 1;
- canvas->drawText(badge_text.c_str(), badge_text.size(), x, y, *paint);
+ canvas->skia_canvas()->drawText(
+ badge_text.c_str(), badge_text.size(), x, y, *paint);
// Return the generated image.
return canvas->ExtractBitmap();
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.cc ('k') | chrome/common/extensions/extension_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698