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

Side by Side Diff: ui/gfx/image/image_skia_util_ios.mm

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/image/image_ios.mm ('k') | ui/gfx/image/image_unittest_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/gfx/image/image_skia_util_ios.h" 5 #include "ui/gfx/image/image_skia_util_ios.h"
6 6
7 #include <UIKit/UIKit.h> 7 #include <UIKit/UIKit.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/scoped_cftyperef.h" 10 #include "base/mac/scoped_cftyperef.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 UIImage* UIImageFromImageSkia(const gfx::ImageSkia& image_skia) { 42 UIImage* UIImageFromImageSkia(const gfx::ImageSkia& image_skia) {
43 return UIImageFromImageSkiaRep(image_skia.GetRepresentation( 43 return UIImageFromImageSkiaRep(image_skia.GetRepresentation(
44 ui::GetMaxScaleFactor())); 44 ui::GetMaxScaleFactor()));
45 } 45 }
46 46
47 UIImage* UIImageFromImageSkiaRep(const gfx::ImageSkiaRep& image_skia_rep) { 47 UIImage* UIImageFromImageSkiaRep(const gfx::ImageSkiaRep& image_skia_rep) {
48 if (image_skia_rep.is_null()) 48 if (image_skia_rep.is_null())
49 return nil; 49 return nil;
50 50
51 float scale = ui::GetScaleFactorScale(image_skia_rep.scale_factor()); 51 float scale = ui::GetScaleFactorScale(image_skia_rep.scale_factor());
52 base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space( 52 base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
53 CGColorSpaceCreateDeviceRGB()); 53 CGColorSpaceCreateDeviceRGB());
54 return gfx::SkBitmapToUIImageWithColorSpace(image_skia_rep.sk_bitmap(), scale, 54 return gfx::SkBitmapToUIImageWithColorSpace(image_skia_rep.sk_bitmap(), scale,
55 color_space); 55 color_space);
56 } 56 }
57 57
58 } // namespace gfx 58 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image_ios.mm ('k') | ui/gfx/image/image_unittest_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698