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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 if (gfx::Display::HasForceDeviceScaleFactor()) { | 614 if (gfx::Display::HasForceDeviceScaleFactor()) { |
615 display_density = gfx::Display::GetForcedDeviceScaleFactor(); | 615 display_density = gfx::Display::GetForcedDeviceScaleFactor(); |
616 } else { | 616 } else { |
617 gfx::DeviceDisplayInfo device_info; | 617 gfx::DeviceDisplayInfo device_info; |
618 display_density = device_info.GetDIPScale(); | 618 display_density = device_info.GetDIPScale(); |
619 } | 619 } |
620 const ScaleFactor closest = FindClosestScaleFactorUnsafe(display_density); | 620 const ScaleFactor closest = FindClosestScaleFactorUnsafe(display_density); |
621 if (closest != SCALE_FACTOR_100P) | 621 if (closest != SCALE_FACTOR_100P) |
622 supported_scale_factors.push_back(closest); | 622 supported_scale_factors.push_back(closest); |
623 #elif defined(OS_IOS) | 623 #elif defined(OS_IOS) |
624 gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); | 624 gfx::Display display = gfx::Screen::GetScreen()->GetPrimaryDisplay(); |
625 if (display.device_scale_factor() > 2.0) { | 625 if (display.device_scale_factor() > 2.0) { |
626 DCHECK_EQ(3.0, display.device_scale_factor()); | 626 DCHECK_EQ(3.0, display.device_scale_factor()); |
627 supported_scale_factors.push_back(SCALE_FACTOR_300P); | 627 supported_scale_factors.push_back(SCALE_FACTOR_300P); |
628 } else if (display.device_scale_factor() > 1.0) { | 628 } else if (display.device_scale_factor() > 1.0) { |
629 DCHECK_EQ(2.0, display.device_scale_factor()); | 629 DCHECK_EQ(2.0, display.device_scale_factor()); |
630 supported_scale_factors.push_back(SCALE_FACTOR_200P); | 630 supported_scale_factors.push_back(SCALE_FACTOR_200P); |
631 } else { | 631 } else { |
632 supported_scale_factors.push_back(SCALE_FACTOR_100P); | 632 supported_scale_factors.push_back(SCALE_FACTOR_100P); |
633 } | 633 } |
634 #elif defined(OS_MACOSX) | 634 #elif defined(OS_MACOSX) |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 // static | 915 // static |
916 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 916 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
917 size_t size, | 917 size_t size, |
918 SkBitmap* bitmap, | 918 SkBitmap* bitmap, |
919 bool* fell_back_to_1x) { | 919 bool* fell_back_to_1x) { |
920 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 920 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
921 return gfx::PNGCodec::Decode(buf, size, bitmap); | 921 return gfx::PNGCodec::Decode(buf, size, bitmap); |
922 } | 922 } |
923 | 923 |
924 } // namespace ui | 924 } // namespace ui |
OLD | NEW |