| 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); | 555 gfx::Display display = gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(); |
| 556 if (display.device_scale_factor() > 1.0) { | 556 if (display.device_scale_factor() > 1.0) { |
| 557 DCHECK_EQ(2.0, display.device_scale_factor()); | 557 DCHECK_EQ(2.0, display.device_scale_factor()); |
| 558 supported_scale_factors.push_back(SCALE_FACTOR_200P); | 558 supported_scale_factors.push_back(SCALE_FACTOR_200P); |
| 559 } else { | 559 } else { |
| 560 supported_scale_factors.push_back(SCALE_FACTOR_100P); | 560 supported_scale_factors.push_back(SCALE_FACTOR_100P); |
| 561 } | 561 } |
| 562 #elif defined(OS_MACOSX) | 562 #elif defined(OS_MACOSX) |
| 563 if (base::mac::IsOSLionOrLater()) | 563 if (base::mac::IsOSLionOrLater()) |
| 564 supported_scale_factors.push_back(SCALE_FACTOR_200P); | 564 supported_scale_factors.push_back(SCALE_FACTOR_200P); |
| 565 #elif defined(OS_WIN) | |
| 566 // Have high-DPI resources for 140% and 180% scaling on Windows based on | |
| 567 // default scaling for Metro mode. Round to nearest supported scale in | |
| 568 // all cases. | |
| 569 if (gfx::IsInHighDPIMode()) { | |
| 570 supported_scale_factors.push_back(SCALE_FACTOR_140P); | |
| 571 supported_scale_factors.push_back(SCALE_FACTOR_180P); | |
| 572 } | |
| 573 #elif defined(OS_CHROMEOS) | 565 #elif defined(OS_CHROMEOS) |
| 574 // TODO(oshima): Include 200P only if the device support 200P | 566 // TODO(oshima): Include 200P only if the device support 200P |
| 575 supported_scale_factors.push_back(SCALE_FACTOR_200P); | 567 supported_scale_factors.push_back(SCALE_FACTOR_200P); |
| 576 #endif | 568 #endif |
| 577 ui::SetSupportedScaleFactors(supported_scale_factors); | 569 ui::SetSupportedScaleFactors(supported_scale_factors); |
| 578 #if defined(OS_WIN) | 570 #if defined(OS_WIN) |
| 579 // Must be called _after_ supported scale factors are set since it | 571 // Must be called _after_ supported scale factors are set since it |
| 580 // uses them. | 572 // uses them. |
| 581 ui::win::InitDeviceScaleFactor(); | 573 ui::win::InitDeviceScaleFactor(); |
| 582 #endif | 574 #endif |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 // static | 796 // static |
| 805 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 797 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
| 806 size_t size, | 798 size_t size, |
| 807 SkBitmap* bitmap, | 799 SkBitmap* bitmap, |
| 808 bool* fell_back_to_1x) { | 800 bool* fell_back_to_1x) { |
| 809 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 801 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
| 810 return gfx::PNGCodec::Decode(buf, size, bitmap); | 802 return gfx::PNGCodec::Decode(buf, size, bitmap); |
| 811 } | 803 } |
| 812 | 804 |
| 813 } // namespace ui | 805 } // namespace ui |
| OLD | NEW |