| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 gfx::Display display = gfx::Screen::GetScreen()->GetPrimaryDisplay(); | 664 gfx::Display display = gfx::Screen::GetScreen()->GetPrimaryDisplay(); |
| 665 if (display.device_scale_factor() > 2.0) { | 665 if (display.device_scale_factor() > 2.0) { |
| 666 DCHECK_EQ(3.0, display.device_scale_factor()); | 666 DCHECK_EQ(3.0, display.device_scale_factor()); |
| 667 supported_scale_factors.push_back(SCALE_FACTOR_300P); | 667 supported_scale_factors.push_back(SCALE_FACTOR_300P); |
| 668 } else if (display.device_scale_factor() > 1.0) { | 668 } else if (display.device_scale_factor() > 1.0) { |
| 669 DCHECK_EQ(2.0, display.device_scale_factor()); | 669 DCHECK_EQ(2.0, display.device_scale_factor()); |
| 670 supported_scale_factors.push_back(SCALE_FACTOR_200P); | 670 supported_scale_factors.push_back(SCALE_FACTOR_200P); |
| 671 } else { | 671 } else { |
| 672 supported_scale_factors.push_back(SCALE_FACTOR_100P); | 672 supported_scale_factors.push_back(SCALE_FACTOR_100P); |
| 673 } | 673 } |
| 674 #elif defined(OS_MACOSX) | 674 #elif defined(OS_MACOSX) || defined(OS_CHROMEOS) || defined(OS_LINUX) || \ |
| 675 if (base::mac::IsOSLionOrLater()) | 675 defined(OS_WIN) |
| 676 supported_scale_factors.push_back(SCALE_FACTOR_200P); | |
| 677 #elif defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_WIN) | |
| 678 supported_scale_factors.push_back(SCALE_FACTOR_200P); | 676 supported_scale_factors.push_back(SCALE_FACTOR_200P); |
| 679 #endif | 677 #endif |
| 680 ui::SetSupportedScaleFactors(supported_scale_factors); | 678 ui::SetSupportedScaleFactors(supported_scale_factors); |
| 681 } | 679 } |
| 682 | 680 |
| 683 void ResourceBundle::FreeImages() { | 681 void ResourceBundle::FreeImages() { |
| 684 images_.clear(); | 682 images_.clear(); |
| 685 } | 683 } |
| 686 | 684 |
| 687 void ResourceBundle::LoadChromeResources() { | 685 void ResourceBundle::LoadChromeResources() { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 // static | 869 // static |
| 872 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 870 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
| 873 size_t size, | 871 size_t size, |
| 874 SkBitmap* bitmap, | 872 SkBitmap* bitmap, |
| 875 bool* fell_back_to_1x) { | 873 bool* fell_back_to_1x) { |
| 876 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 874 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
| 877 return gfx::PNGCodec::Decode(buf, size, bitmap); | 875 return gfx::PNGCodec::Decode(buf, size, bitmap); |
| 878 } | 876 } |
| 879 | 877 |
| 880 } // namespace ui | 878 } // namespace ui |
| OLD | NEW |