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

Unified Diff: ui/chromeos/network/network_icon.cc

Issue 2016833002: Use initialized canvas to create network icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | ui/gfx/canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/chromeos/network/network_icon.cc
diff --git a/ui/chromeos/network/network_icon.cc b/ui/chromeos/network/network_icon.cc
index 395bd620edc3b6865b5b0d0135e75f252c703fcc..591ee14a453b6bfe93b01c961bda86d8660215d5 100644
--- a/ui/chromeos/network/network_icon.cc
+++ b/ui/chromeos/network/network_icon.cc
@@ -230,10 +230,9 @@ class NetworkIconImageSource : public gfx::ImageSkiaSource {
// TODO(pkotwicz): Figure out what to do when a new image resolution becomes
// available.
gfx::ImageSkiaRep GetImageForScale(float scale) override {
- gfx::ImageSkiaRep icon_rep = icon_.GetRepresentation(scale);
- if (icon_rep.is_null())
- return gfx::ImageSkiaRep();
- gfx::Canvas canvas(icon_rep, false);
+ gfx::Canvas canvas(icon_.size(), scale, false);
+ canvas.DrawImageInt(icon_, 0, 0);
+
if (badges_.top_left)
canvas.DrawImageInt(*badges_.top_left, 0, 0);
if (badges_.top_right)
« no previous file with comments | « no previous file | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698