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

Unified Diff: src/utils/ios/SkImageDecoder_iOS.mm

Issue 1197963003: Remove old iOS porting files. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/ios/SkFontHost_iOS.mm ('k') | src/utils/ios/SkOSFile_iOS.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/ios/SkImageDecoder_iOS.mm
diff --git a/src/utils/ios/SkImageDecoder_iOS.mm b/src/utils/ios/SkImageDecoder_iOS.mm
deleted file mode 100755
index f3db65e03552f7b22b88709cd3e657769f77cc35..0000000000000000000000000000000000000000
--- a/src/utils/ios/SkImageDecoder_iOS.mm
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#import <CoreGraphics/CoreGraphics.h>
-#include <CoreGraphics/CGColorSpace.h>
-#import <UIKit/UIKit.h>
-
-#include "SkImageDecoder.h"
-#include "SkImageEncoder.h"
-#include "SkMovie.h"
-#include "SkStream_NSData.h"
-
-class SkImageDecoder_iOS : public SkImageDecoder {
-protected:
- virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode);
-};
-
-#define BITMAP_INFO (kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast)
-
-bool SkImageDecoder_iOS::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
-
- NSData* data = NSData_dataWithStream(stream);
-
- UIImage* uimage = [UIImage imageWithData:data];
-
- const int width = uimage.size.width;
- const int height = uimage.size.height;
- bm->setInfo(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType), 0);
- if (SkImageDecoder::kDecodeBounds_Mode == mode) {
- return true;
- }
-
- if (!this->allocPixelRef(bm, NULL)) {
- return false;
- }
-
- bm->lockPixels();
- bm->eraseColor(0);
-
- CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB();
- CGContextRef cg = CGBitmapContextCreate(bm->getPixels(), width, height,
- 8, bm->rowBytes(), cs, BITMAP_INFO);
- CGContextDrawImage(cg, CGRectMake(0, 0, width, height), uimage.CGImage);
- CGContextRelease(cg);
- CGColorSpaceRelease(cs);
-
- bm->unlockPixels();
- return true;
-}
-
-/////////////////////////////////////////////////////////////////////////
-
-SkImageDecoder* SkImageDecoder::Factory(SkStreamRewindable* stream) {
- return new SkImageDecoder_iOS;
-}
-
-SkMovie* SkMovie::DecodeStream(SkStreamRewindable* stream) {
- return NULL;
-}
-
-
« no previous file with comments | « src/utils/ios/SkFontHost_iOS.mm ('k') | src/utils/ios/SkOSFile_iOS.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698