Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ui / gfx / image / image_skia_util_ios.h
blobff4468d94ceb43f2d5f9e838059b7b18be4453d8
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
3 // found in the LICENSE file.
5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_
6 #define UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_
8 #include "ui/base/layout.h"
9 #include "ui/base/ui_export.h"
11 #ifdef __OBJC__
12 @class UIImage;
13 #else
14 class UIImage;
15 #endif
17 namespace gfx {
18 class ImageSkia;
19 class ImageSkiaRep;
21 // Converts to ImageSkia from UIImage.
22 UI_EXPORT gfx::ImageSkia ImageSkiaFromUIImage(UIImage* image);
24 // Converts to an ImageSkiaRep of |scale_factor| from UIImage.
25 // |scale_factor| is passed explicitly in order to allow this method to be used
26 // with a |scale_factor| which is not supported by the platform.
27 // (ui::GetScaleFactorFromScale() is restricted to the platform's supported
28 // scale factors.)
29 UI_EXPORT gfx::ImageSkiaRep ImageSkiaRepOfScaleFactorFromUIImage(
30 UIImage* image,
31 ui::ScaleFactor scale_factor);
33 // 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
35 // scale factor (eg Retina iPad -> 2x). Returns an autoreleased UIImage.
36 UI_EXPORT UIImage* UIImageFromImageSkia(const gfx::ImageSkia& image_skia);
38 // Converts to UIImage from ImageSkiaRep. Returns an autoreleased UIImage.
39 UI_EXPORT UIImage* UIImageFromImageSkiaRep(
40 const gfx::ImageSkiaRep& image_skia_rep);
42 } // namespace gfx
44 #endif // UI_GFX_IMAGE_IMAGE_SKIA_UTIL_IOS_H_