Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: ui/base/resource/resource_bundle_win.cc

Issue 211493009: Ensure that extension resources are loaded with the correct scaling applied on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed the GetImageScaleForScaleFactor function Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« ui/base/layout.h ('K') | « ui/base/resource/resource_bundle.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
OLDNEW
« ui/base/layout.h ('K') | « ui/base/resource/resource_bundle.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698