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

Side by Side Diff: src/utils/ios/SkImageDecoder_iOS.mm

Issue 322403007: Fix a number of issues with iOS build. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove SKOSFile_iOS.mm a little more cleanly (and clearly) Created 6 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
« no previous file with comments | « src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #import <CoreGraphics/CoreGraphics.h> 8 #import <CoreGraphics/CoreGraphics.h>
9 #include <CoreGraphics/CGColorSpace.h> 9 #include <CoreGraphics/CGColorSpace.h>
10 #import <UIKit/UIKit.h> 10 #import <UIKit/UIKit.h>
(...skipping 11 matching lines...) Expand all
22 #define BITMAP_INFO (kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast) 22 #define BITMAP_INFO (kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast)
23 23
24 bool SkImageDecoder_iOS::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { 24 bool SkImageDecoder_iOS::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
25 25
26 NSData* data = NSData_dataWithStream(stream); 26 NSData* data = NSData_dataWithStream(stream);
27 27
28 UIImage* uimage = [UIImage imageWithData:data]; 28 UIImage* uimage = [UIImage imageWithData:data];
29 29
30 const int width = uimage.size.width; 30 const int width = uimage.size.width;
31 const int height = uimage.size.height; 31 const int height = uimage.size.height;
32 bm->setConfig(SkBitmap::kARGB_8888_Config, width, height); 32 SkColorType ct = SkBitmapConfigToColorType(SkBitmap::kARGB_8888_Config);
33 bm->setInfo(SkImageInfo::Make(width, height, ct, kPremul_SkAlphaType), 0);
33 if (SkImageDecoder::kDecodeBounds_Mode == mode) { 34 if (SkImageDecoder::kDecodeBounds_Mode == mode) {
34 return true; 35 return true;
35 } 36 }
36 37
37 if (!this->allocPixelRef(bm, NULL)) { 38 if (!this->allocPixelRef(bm, NULL)) {
38 return false; 39 return false;
39 } 40 }
40 41
41 bm->lockPixels(); 42 bm->lockPixels();
42 bm->eraseColor(0); 43 bm->eraseColor(0);
(...skipping 16 matching lines...) Expand all
59 } 60 }
60 61
61 SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) { 62 SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) {
62 return NULL; 63 return NULL;
63 } 64 }
64 65
65 SkImageEncoder* SkImageEncoder::Create(Type t) { 66 SkImageEncoder* SkImageEncoder::Create(Type t) {
66 return NULL; 67 return NULL;
67 } 68 }
68 69
OLDNEW
« no previous file with comments | « src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698