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 28 matching lines...) Expand all Loading... |
39 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
40 #include "ui/base/resource/resource_bundle_android.h" | 40 #include "ui/base/resource/resource_bundle_android.h" |
41 #endif | 41 #endif |
42 | 42 |
43 #if defined(OS_CHROMEOS) | 43 #if defined(OS_CHROMEOS) |
44 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
45 #include "ui/gfx/platform_font_pango.h" | 45 #include "ui/gfx/platform_font_pango.h" |
46 #endif | 46 #endif |
47 | 47 |
48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
49 #include "ui/base/win/dpi_setup.h" | |
50 #include "ui/gfx/win/dpi.h" | 49 #include "ui/gfx/win/dpi.h" |
51 #endif | 50 #endif |
52 | 51 |
53 #if defined(OS_MACOSX) && !defined(OS_IOS) | 52 #if defined(OS_MACOSX) && !defined(OS_IOS) |
54 #include "base/mac/mac_util.h" | 53 #include "base/mac/mac_util.h" |
55 #endif | 54 #endif |
56 | 55 |
57 namespace ui { | 56 namespace ui { |
58 | 57 |
59 namespace { | 58 namespace { |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 if (default_to_100P) | 641 if (default_to_100P) |
643 supported_scale_factors.push_back(SCALE_FACTOR_100P); | 642 supported_scale_factors.push_back(SCALE_FACTOR_100P); |
644 #endif | 643 #endif |
645 ui::SetSupportedScaleFactors(supported_scale_factors); | 644 ui::SetSupportedScaleFactors(supported_scale_factors); |
646 #if defined(OS_WIN) | 645 #if defined(OS_WIN) |
647 // Must be called _after_ supported scale factors are set since it | 646 // Must be called _after_ supported scale factors are set since it |
648 // uses them. | 647 // uses them. |
649 // Don't initialize the device scale factor if it has already been | 648 // Don't initialize the device scale factor if it has already been |
650 // initialized. | 649 // initialized. |
651 if (!gfx::win::IsDeviceScaleFactorSet()) | 650 if (!gfx::win::IsDeviceScaleFactorSet()) |
652 ui::win::InitDeviceScaleFactor(); | 651 gfx::InitDeviceScaleFactor(gfx::GetDPIScale()); |
653 #endif | 652 #endif |
654 } | 653 } |
655 | 654 |
656 void ResourceBundle::FreeImages() { | 655 void ResourceBundle::FreeImages() { |
657 images_.clear(); | 656 images_.clear(); |
658 } | 657 } |
659 | 658 |
660 void ResourceBundle::AddDataPackFromPathInternal(const base::FilePath& path, | 659 void ResourceBundle::AddDataPackFromPathInternal(const base::FilePath& path, |
661 ScaleFactor scale_factor, | 660 ScaleFactor scale_factor, |
662 bool optional) { | 661 bool optional) { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 // static | 858 // static |
860 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 859 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
861 size_t size, | 860 size_t size, |
862 SkBitmap* bitmap, | 861 SkBitmap* bitmap, |
863 bool* fell_back_to_1x) { | 862 bool* fell_back_to_1x) { |
864 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 863 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
865 return gfx::PNGCodec::Decode(buf, size, bitmap); | 864 return gfx::PNGCodec::Decode(buf, size, bitmap); |
866 } | 865 } |
867 | 866 |
868 } // namespace ui | 867 } // namespace ui |
OLD | NEW |