OLD | NEW |
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/base/resource/resource_bundle.h" | 5 #include "ui/base/resource/resource_bundle.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ui/gfx/codec/png_codec.h" | 28 #include "ui/gfx/codec/png_codec.h" |
29 #include "ui/gfx/image/image_skia.h" | 29 #include "ui/gfx/image/image_skia.h" |
30 #include "ui/gfx/screen.h" | 30 #include "ui/gfx/screen.h" |
31 #include "ui/gfx/skbitmap_operations.h" | 31 #include "ui/gfx/skbitmap_operations.h" |
32 | 32 |
33 namespace ui { | 33 namespace ui { |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 // Font sizes relative to base font. | 37 // Font sizes relative to base font. |
38 #if defined(OS_CHROMEOS) && defined(CROS_FONTS_USING_BCI) | |
39 const int kSmallFontSizeDelta = -3; | |
40 const int kMediumFontSizeDelta = 2; | |
41 const int kLargeFontSizeDelta = 7; | |
42 #else | |
43 const int kSmallFontSizeDelta = -2; | 38 const int kSmallFontSizeDelta = -2; |
44 const int kMediumFontSizeDelta = 3; | 39 const int kMediumFontSizeDelta = 3; |
45 const int kLargeFontSizeDelta = 8; | 40 const int kLargeFontSizeDelta = 8; |
46 #endif | |
47 | 41 |
48 // Returns the actual scale factor of |bitmap| given the image representations | 42 // Returns the actual scale factor of |bitmap| given the image representations |
49 // which have already been added to |image|. | 43 // which have already been added to |image|. |
50 // TODO(pkotwicz): Remove this once we are no longer loading 1x resources | 44 // TODO(pkotwicz): Remove this once we are no longer loading 1x resources |
51 // as part of 2x data packs. | 45 // as part of 2x data packs. |
52 ui::ScaleFactor GetActualScaleFactor(const gfx::ImageSkia& image, | 46 ui::ScaleFactor GetActualScaleFactor(const gfx::ImageSkia& image, |
53 const SkBitmap& bitmap, | 47 const SkBitmap& bitmap, |
54 ui::ScaleFactor data_pack_scale_factor) { | 48 ui::ScaleFactor data_pack_scale_factor) { |
55 if (image.empty()) | 49 if (image.empty()) |
56 return data_pack_scale_factor; | 50 return data_pack_scale_factor; |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 SkBitmap bitmap; | 565 SkBitmap bitmap; |
572 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 32, 32); | 566 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 32, 32); |
573 bitmap.allocPixels(); | 567 bitmap.allocPixels(); |
574 bitmap.eraseARGB(255, 255, 0, 0); | 568 bitmap.eraseARGB(255, 255, 0, 0); |
575 empty_image_ = gfx::Image(bitmap); | 569 empty_image_ = gfx::Image(bitmap); |
576 } | 570 } |
577 return empty_image_; | 571 return empty_image_; |
578 } | 572 } |
579 | 573 |
580 } // namespace ui | 574 } // namespace ui |
OLD | NEW |