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 <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/big_endian.h" | 10 #include "base/big_endian.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // PNG-related constants. | 62 // PNG-related constants. |
63 const unsigned char kPngMagic[8] = { 0x89, 'P', 'N', 'G', 13, 10, 26, 10 }; | 63 const unsigned char kPngMagic[8] = { 0x89, 'P', 'N', 'G', 13, 10, 26, 10 }; |
64 const size_t kPngChunkMetadataSize = 12; // length, type, crc32 | 64 const size_t kPngChunkMetadataSize = 12; // length, type, crc32 |
65 const unsigned char kPngScaleChunkType[4] = { 'c', 's', 'C', 'l' }; | 65 const unsigned char kPngScaleChunkType[4] = { 'c', 's', 'C', 'l' }; |
66 const unsigned char kPngDataChunkType[4] = { 'I', 'D', 'A', 'T' }; | 66 const unsigned char kPngDataChunkType[4] = { 'I', 'D', 'A', 'T' }; |
67 | 67 |
68 ResourceBundle* g_shared_instance_ = NULL; | 68 ResourceBundle* g_shared_instance_ = NULL; |
69 | 69 |
70 void InitDefaultFontList() { | 70 void InitDefaultFontList() { |
71 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) && defined(USE_PANGO) |
72 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 72 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
73 std::string font_family = base::UTF16ToUTF8( | 73 std::string font_family = base::UTF16ToUTF8( |
74 rb.GetLocalizedString(IDS_UI_FONT_FAMILY_CROS)); | 74 rb.GetLocalizedString(IDS_UI_FONT_FAMILY_CROS)); |
75 gfx::FontList::SetDefaultFontDescription(font_family); | 75 gfx::FontList::SetDefaultFontDescription(font_family); |
76 | 76 |
77 // TODO(yukishiino): Remove SetDefaultFontDescription() once the migration to | 77 // TODO(yukishiino): Remove SetDefaultFontDescription() once the migration to |
78 // the font list is done. We will no longer need SetDefaultFontDescription() | 78 // the font list is done. We will no longer need SetDefaultFontDescription() |
79 // after every client gets started using a FontList instead of a Font. | 79 // after every client gets started using a FontList instead of a Font. |
80 gfx::PlatformFontPango::SetDefaultFontDescription(font_family); | 80 gfx::PlatformFontPango::SetDefaultFontDescription(font_family); |
81 #else | 81 #else |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 // static | 833 // static |
834 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 834 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
835 size_t size, | 835 size_t size, |
836 SkBitmap* bitmap, | 836 SkBitmap* bitmap, |
837 bool* fell_back_to_1x) { | 837 bool* fell_back_to_1x) { |
838 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 838 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
839 return gfx::PNGCodec::Decode(buf, size, bitmap); | 839 return gfx::PNGCodec::Decode(buf, size, bitmap); |
840 } | 840 } |
841 | 841 |
842 } // namespace ui | 842 } // namespace ui |
OLD | NEW |