| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" |
| 5 | 6 |
| 6 #include <math.h> | 7 #include <math.h> |
| 8 #if defined(OS_WIN) |
| 7 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif |
| 8 | 11 |
| 9 #include "chrome/common/gfx/color_utils.h" | 12 #include "chrome/common/gfx/color_utils.h" |
| 10 | 13 |
| 11 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 12 #include "base/gfx/skia_utils.h" | 15 #include "base/gfx/skia_utils.h" |
| 13 #include "base/logging.h" | 16 #include "base/logging.h" |
| 14 #include "skia/include/SkBitmap.h" | 17 #include "skia/include/SkBitmap.h" |
| 15 | 18 |
| 16 namespace color_utils { | 19 namespace color_utils { |
| 17 | 20 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 histogram[GetLumaForColor(current_color)]++; | 244 histogram[GetLumaForColor(current_color)]++; |
| 242 } | 245 } |
| 243 } | 246 } |
| 244 } | 247 } |
| 245 | 248 |
| 246 SkColor SetColorAlpha(SkColor c, SkAlpha alpha) { | 249 SkColor SetColorAlpha(SkColor c, SkAlpha alpha) { |
| 247 return SkColorSetARGB(alpha, SkColorGetR(c), SkColorGetG(c), SkColorGetB(c)); | 250 return SkColorSetARGB(alpha, SkColorGetR(c), SkColorGetG(c), SkColorGetB(c)); |
| 248 } | 251 } |
| 249 | 252 |
| 250 SkColor GetSysSkColor(int which) { | 253 SkColor GetSysSkColor(int which) { |
| 254 #if defined(OS_WIN) |
| 251 return gfx::COLORREFToSkColor(::GetSysColor(which)); | 255 return gfx::COLORREFToSkColor(::GetSysColor(which)); |
| 256 #else |
| 257 NOTIMPLEMENTED(); |
| 258 return SK_ColorLTGRAY; |
| 259 #endif |
| 252 } | 260 } |
| 253 | 261 |
| 254 } // namespace color_utils | 262 } // namespace color_utils |
| 255 | 263 |
| OLD | NEW |