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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 default_to_100P = false; | 598 default_to_100P = false; |
599 } | 599 } |
600 } | 600 } |
601 if (default_to_100P) | 601 if (default_to_100P) |
602 supported_scale_factors.push_back(SCALE_FACTOR_100P); | 602 supported_scale_factors.push_back(SCALE_FACTOR_100P); |
603 #endif | 603 #endif |
604 ui::SetSupportedScaleFactors(supported_scale_factors); | 604 ui::SetSupportedScaleFactors(supported_scale_factors); |
605 #if defined(OS_WIN) | 605 #if defined(OS_WIN) |
606 // Must be called _after_ supported scale factors are set since it | 606 // Must be called _after_ supported scale factors are set since it |
607 // uses them. | 607 // uses them. |
608 ui::win::InitDeviceScaleFactor(); | 608 // Don't initialize the device scale factor if it has already been |
| 609 // initialized. |
| 610 if (!gfx::win::IsDeviceScaleFactorSet()) |
| 611 ui::win::InitDeviceScaleFactor(); |
609 #endif | 612 #endif |
610 } | 613 } |
611 | 614 |
612 void ResourceBundle::FreeImages() { | 615 void ResourceBundle::FreeImages() { |
613 images_.clear(); | 616 images_.clear(); |
614 } | 617 } |
615 | 618 |
616 void ResourceBundle::AddDataPackFromPathInternal(const base::FilePath& path, | 619 void ResourceBundle::AddDataPackFromPathInternal(const base::FilePath& path, |
617 ScaleFactor scale_factor, | 620 ScaleFactor scale_factor, |
618 bool optional) { | 621 bool optional) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 // static | 819 // static |
817 bool ResourceBundle::DecodePNG(const unsigned char* buf, | 820 bool ResourceBundle::DecodePNG(const unsigned char* buf, |
818 size_t size, | 821 size_t size, |
819 SkBitmap* bitmap, | 822 SkBitmap* bitmap, |
820 bool* fell_back_to_1x) { | 823 bool* fell_back_to_1x) { |
821 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); | 824 *fell_back_to_1x = PNGContainsFallbackMarker(buf, size); |
822 return gfx::PNGCodec::Decode(buf, size, bitmap); | 825 return gfx::PNGCodec::Decode(buf, size, bitmap); |
823 } | 826 } |
824 | 827 |
825 } // namespace ui | 828 } // namespace ui |
OLD | NEW |