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

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

Issue 353683003: Another iOS fix for SampleApp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | 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 SkColorType ct = SkBitmapConfigToColorType(SkBitmap::kARGB_8888_Config); 32 bm->setInfo(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType), 0);
33 bm->setInfo(SkImageInfo::Make(width, height, ct, kPremul_SkAlphaType), 0);
34 if (SkImageDecoder::kDecodeBounds_Mode == mode) { 33 if (SkImageDecoder::kDecodeBounds_Mode == mode) {
35 return true; 34 return true;
36 } 35 }
37 36
38 if (!this->allocPixelRef(bm, NULL)) { 37 if (!this->allocPixelRef(bm, NULL)) {
39 return false; 38 return false;
40 } 39 }
41 40
42 bm->lockPixels(); 41 bm->lockPixels();
43 bm->eraseColor(0); 42 bm->eraseColor(0);
(...skipping 16 matching lines...) Expand all
60 } 59 }
61 60
62 SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) { 61 SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) {
63 return NULL; 62 return NULL;
64 } 63 }
65 64
66 SkImageEncoder* SkImageEncoder::Create(Type t) { 65 SkImageEncoder* SkImageEncoder::Create(Type t) {
67 return NULL; 66 return NULL;
68 } 67 }
69 68
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698