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

Side by Side Diff: ui/message_center/views/notification_view.cc

Issue 76683003: remove references to DEPRECATED SkBitmap::kA1_Config. No functional change expected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
« no previous file with comments | « ui/gfx/ozone/dri/dri_skbitmap.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/message_center/views/notification_view.h" 5 #include "ui/message_center/views/notification_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 factor = ui::GetScaleFactorForNativeView(widget->GetNativeView()); 105 factor = ui::GetScaleFactorForNativeView(widget->GetNativeView());
106 if (factor == ui::SCALE_FACTOR_NONE) 106 if (factor == ui::SCALE_FACTOR_NONE)
107 factor = ui::SCALE_FACTOR_100P; 107 factor = ui::SCALE_FACTOR_100P;
108 } 108 }
109 109
110 // Extract that bitmap's alpha and look for a non-opaque pixel there. 110 // Extract that bitmap's alpha and look for a non-opaque pixel there.
111 SkBitmap bitmap = 111 SkBitmap bitmap =
112 image.GetRepresentation(ui::GetImageScale(factor)).sk_bitmap(); 112 image.GetRepresentation(ui::GetImageScale(factor)).sk_bitmap();
113 if (!bitmap.isNull()) { 113 if (!bitmap.isNull()) {
114 SkBitmap alpha; 114 SkBitmap alpha;
115 alpha.setConfig(SkBitmap::kA1_Config, bitmap.width(), bitmap.height(), 0);
116 bitmap.extractAlpha(&alpha); 115 bitmap.extractAlpha(&alpha);
117 for (int y = 0; y < bitmap.height(); ++y) { 116 for (int y = 0; y < bitmap.height(); ++y) {
118 for (int x = 0; x < bitmap.width(); ++x) { 117 for (int x = 0; x < bitmap.width(); ++x) {
119 if (alpha.getColor(x, y) != SK_ColorBLACK) { 118 if (alpha.getColor(x, y) != SK_ColorBLACK) {
120 return true; 119 return true;
121 } 120 }
122 } 121 }
123 } 122 }
124 } 123 }
125 124
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 return message_view_ ? 794 return message_view_ ?
796 message_view_->GetLinesForWidthAndLimit(width, limit) : 0; 795 message_view_->GetLinesForWidthAndLimit(width, limit) : 0;
797 } 796 }
798 797
799 int NotificationView::GetMessageHeight(int width, int limit) { 798 int NotificationView::GetMessageHeight(int width, int limit) {
800 return message_view_ ? 799 return message_view_ ?
801 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0; 800 message_view_->GetSizeForWidthAndLines(width, limit).height() : 0;
802 } 801 }
803 802
804 } // namespace message_center 803 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/gfx/ozone/dri/dri_skbitmap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698