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

Unified Diff: ui/gfx/image/image_mac.mm

Issue 10545069: Fixes conversion from NSImage to ImageSkia when NSImageRep has size which isn't it's pixel size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/image/image_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_mac.mm
diff --git a/ui/gfx/image/image_mac.mm b/ui/gfx/image/image_mac.mm
index eeed857ecf963897b72267607626022668bc8d77..68e541c36b0b47af44cdd76b76f2b387a58f6d5e 100644
--- a/ui/gfx/image/image_mac.mm
+++ b/ui/gfx/image/image_mac.mm
@@ -17,7 +17,8 @@ namespace internal {
gfx::ImageSkia NSImageToImageSkia(NSImage* image) {
gfx::ImageSkia image_skia;
for (NSImageRep* imageRep in [image representations]) {
- NSSize imageRepSize = [imageRep size];
+ NSSize imageRepSize =
+ NSMakeSize([imageRep pixelsWide], [imageRep pixelsHigh]);
SkBitmap bitmap(gfx::NSImageRepToSkBitmap(imageRep, imageRepSize, false));
if (!bitmap.isNull() && !bitmap.empty()) {
float scaleFactor = imageRepSize.width / [image size].width;
« no previous file with comments | « no previous file | ui/gfx/image/image_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698