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

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

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename methods and vars to make image_scale more clear Created 7 years, 3 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
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 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_ 5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_
6 #define UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_ 6 #define UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_
7 7
8 #include "ui/base/layout.h"
9 #include "ui/gfx/gfx_export.h" 8 #include "ui/gfx/gfx_export.h"
10 9
11 #ifdef __OBJC__ 10 #ifdef __OBJC__
12 @class UIImage; 11 @class UIImage;
13 #else 12 #else
14 class UIImage; 13 class UIImage;
15 #endif 14 #endif
16 15
17 namespace gfx { 16 namespace gfx {
18 class ImageSkia; 17 class ImageSkia;
19 class ImageSkiaRep; 18 class ImageSkiaRep;
20 19
21 // Converts to ImageSkia from UIImage. 20 // Converts to ImageSkia from UIImage.
22 UI_EXPORT gfx::ImageSkia ImageSkiaFromUIImage(UIImage* image); 21 UI_EXPORT gfx::ImageSkia ImageSkiaFromUIImage(UIImage* image);
23 22
24 // Converts to an ImageSkiaRep of |scale_factor| from UIImage. 23 // Converts to an ImageSkiaRep of |scale_factor| from UIImage.
25 // |scale_factor| is passed explicitly in order to allow this method to be used 24 // |scale| is passed explicitly in order to allow this method to be used
26 // with a |scale_factor| which is not supported by the platform. 25 // with a |scale| which is not supported by the platform.
27 // (ui::GetScaleFactorFromScale() is restricted to the platform's supported 26 UI_EXPORT gfx::ImageSkiaRep ImageSkiaRepOfScaleFromUIImage(
28 // scale factors.)
29 UI_EXPORT gfx::ImageSkiaRep ImageSkiaRepOfScaleFactorFromUIImage(
30 UIImage* image, 27 UIImage* image,
31 ui::ScaleFactor scale_factor); 28 float scale);
32 29
33 // Converts to UIImage from ImageSkia. The returned UIImage will be at the scale 30 // Converts to UIImage from ImageSkia. The returned UIImage will be at the scale
34 // of the ImageSkiaRep in |image_skia| which most closely matches the device's 31 // of the ImageSkiaRep in |image_skia| which most closely matches the device's
35 // scale factor (eg Retina iPad -> 2x). Returns an autoreleased UIImage. 32 // scale factor (eg Retina iPad -> 2x). Returns an autoreleased UIImage.
36 UI_EXPORT UIImage* UIImageFromImageSkia(const gfx::ImageSkia& image_skia); 33 UI_EXPORT UIImage* UIImageFromImageSkia(const gfx::ImageSkia& image_skia);
37 34
38 // Converts to UIImage from ImageSkiaRep. Returns an autoreleased UIImage. 35 // Converts to UIImage from ImageSkiaRep. Returns an autoreleased UIImage.
39 UI_EXPORT UIImage* UIImageFromImageSkiaRep( 36 UI_EXPORT UIImage* UIImageFromImageSkiaRep(
40 const gfx::ImageSkiaRep& image_skia_rep); 37 const gfx::ImageSkiaRep& image_skia_rep);
41 38
42 } // namespace gfx 39 } // namespace gfx
43 40
44 #endif // UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_ 41 #endif // UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698