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

Side by Side Diff: chrome/browser/chromeos/status/network_menu_icon.cc

Issue 8609002: CrOs: Remove 16 exit time destructors and 11 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/status/network_menu_icon.h" 5 #include "chrome/browser/chromeos/status/network_menu_icon.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 int y = min(kBadgeBottomY, icon.height() - bottom_right_badge->height()); 692 int y = min(kBadgeBottomY, icon.height() - bottom_right_badge->height());
693 canvas.DrawBitmapInt(*bottom_right_badge, x, y); 693 canvas.DrawBitmapInt(*bottom_right_badge, x, y);
694 } 694 }
695 695
696 return canvas.ExtractBitmap(); 696 return canvas.ExtractBitmap();
697 } 697 }
698 698
699 // We blend connecting icons with a black image to generate a faded icon. 699 // We blend connecting icons with a black image to generate a faded icon.
700 const SkBitmap NetworkMenuIcon::GenerateConnectingBitmap( 700 const SkBitmap NetworkMenuIcon::GenerateConnectingBitmap(
701 const SkBitmap& source) { 701 const SkBitmap& source) {
702 static SkBitmap empty_badge; 702 CR_DEFINE_STATIC_LOCAL(SkBitmap, empty_badge, ());
703 if (empty_badge.empty()) { 703 if (empty_badge.empty()) {
704 empty_badge.setConfig(SkBitmap::kARGB_8888_Config, 704 empty_badge.setConfig(SkBitmap::kARGB_8888_Config,
705 source.width(), source.height(), 0); 705 source.width(), source.height(), 0);
706 empty_badge.allocPixels(); 706 empty_badge.allocPixels();
707 empty_badge.eraseARGB(0, 0, 0, 0); 707 empty_badge.eraseARGB(0, 0, 0, 0);
708 } 708 }
709 DCHECK(empty_badge.width() == source.width()); 709 DCHECK(empty_badge.width() == source.width());
710 DCHECK(empty_badge.height() == source.height()); 710 DCHECK(empty_badge.height() == source.height());
711 return SkBitmapOperations::CreateBlendedBitmap( 711 return SkBitmapOperations::CreateBlendedBitmap(
712 empty_badge, source, kConnectingImageAlpha); 712 empty_badge, source, kConnectingImageAlpha);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 const SkBitmap NetworkMenuIcon::GetConnectedBitmap(BitmapType type) { 796 const SkBitmap NetworkMenuIcon::GetConnectedBitmap(BitmapType type) {
797 return GetBitmap(type, NumBitmaps(type) - 1); 797 return GetBitmap(type, NumBitmaps(type) - 1);
798 } 798 }
799 799
800 int NetworkMenuIcon::NumBitmaps(BitmapType type) { 800 int NetworkMenuIcon::NumBitmaps(BitmapType type) {
801 return (type == ARCS) ? kNumArcsImages : kNumBarsImages; 801 return (type == ARCS) ? kNumArcsImages : kNumBarsImages;
802 } 802 }
803 803
804 } // chromeos 804 } // chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698