| Index: skia/ext/skia_utils_ios.mm
|
| diff --git a/skia/ext/skia_utils_ios.mm b/skia/ext/skia_utils_ios.mm
|
| index 9d4c14a45f83892c27b86b531ae544854c96ae24..a52a998b7694ef3fafe8667ed83195e2cadb3b14 100644
|
| --- a/skia/ext/skia_utils_ios.mm
|
| +++ b/skia/ext/skia_utils_ios.mm
|
| @@ -47,6 +47,12 @@ SkBitmap UIImageToSkBitmap(UIImage* image, CGSize size, bool is_opaque) {
|
| if (!context)
|
| return bitmap;
|
|
|
| + // We need to invert the y-axis of the canvas so that Core Graphics drawing
|
| + // happens right-side up. Skia has an upper-left origin and CG has a lower-
|
| + // left one.
|
| + CGContextScaleCTM(context, 1.0, -1.0);
|
| + CGContextTranslateCTM(context, 0, -size.height);
|
| +
|
| // UIGraphicsPushContext be called from the main thread.
|
| // TODO(rohitrao): We can use CG to make this thread safe, but the mac code
|
| // calls setCurrentContext, so it's similarly limited to the main thread.
|
|
|