| 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_win.h" | 5 #include "ui/base/resource/resource_bundle_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "skia/ext/image_operations.h" | 10 #include "skia/ext/image_operations.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 scaled_image = skia::ImageOperations::Resize( | 86 scaled_image = skia::ImageOperations::Resize( |
| 87 image, | 87 image, |
| 88 skia::ImageOperations::RESIZE_LANCZOS3, | 88 skia::ImageOperations::RESIZE_LANCZOS3, |
| 89 scaled_size.width(), | 89 scaled_size.width(), |
| 90 scaled_size.height()); | 90 scaled_size.height()); |
| 91 DCHECK_EQ(scaled_image.width(), scaled_size.width()); | 91 DCHECK_EQ(scaled_image.width(), scaled_size.width()); |
| 92 DCHECK_EQ(scaled_image.height(), scaled_size.height()); | 92 DCHECK_EQ(scaled_image.height(), scaled_size.height()); |
| 93 return scaled_image; | 93 return scaled_image; |
| 94 } | 94 } |
| 95 | 95 |
| 96 float ResourceBundle::PlatformGetImageScale() { | |
| 97 if (!gfx::IsHighDPIEnabled()) | |
| 98 return ui::GetImageScale(GetMaxScaleFactor()); | |
| 99 return gfx::win::GetDeviceScaleFactor(); | |
| 100 } | |
| 101 | |
| 102 void SetResourcesDataDLL(HINSTANCE handle) { | 96 void SetResourcesDataDLL(HINSTANCE handle) { |
| 103 resources_data_dll = handle; | 97 resources_data_dll = handle; |
| 104 } | 98 } |
| 105 | 99 |
| 106 HICON LoadThemeIconFromResourcesDataDLL(int icon_id) { | 100 HICON LoadThemeIconFromResourcesDataDLL(int icon_id) { |
| 107 return ::LoadIcon(GetCurrentResourceDLL(), MAKEINTRESOURCE(icon_id)); | 101 return ::LoadIcon(GetCurrentResourceDLL(), MAKEINTRESOURCE(icon_id)); |
| 108 } | 102 } |
| 109 | 103 |
| 110 } // namespace ui; | 104 } // namespace ui; |
| OLD | NEW |