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

Side by Side Diff: skia/ext/skia_utils_ios.mm

Issue 1413903008: Add LargeIconCache and LargeIconServiceFactory for iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: broken sort Created 5 years, 1 month 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
« skia/ext/skia_utils_ios.h ('K') | « skia/ext/skia_utils_ios.h ('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 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "skia/ext/skia_utils_ios.h" 5 #include "skia/ext/skia_utils_ios.h"
6 6
7 #import <ImageIO/ImageIO.h> 7 #import <ImageIO/ImageIO.h>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include "base/ios/ios_util.h" 10 #include "base/ios/ios_util.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const SkBitmap bitmap = CGImageToSkBitmap(cg_image, size, false); 116 const SkBitmap bitmap = CGImageToSkBitmap(cg_image, size, false);
117 if (!bitmap.empty()) 117 if (!bitmap.empty())
118 frames.push_back(bitmap); 118 frames.push_back(bitmap);
119 } 119 }
120 120
121 DLOG_IF(WARNING, frames.size() != count) << "Only decoded " << frames.size() 121 DLOG_IF(WARNING, frames.size() != count) << "Only decoded " << frames.size()
122 << " frames for " << count << " expected."; 122 << " frames for " << count << " expected.";
123 return frames; 123 return frames;
124 } 124 }
125 125
126 UIColor* ColorFromSkColor(SkColor color, CGFloat alpha) {
127 return [UIColor colorWithRed:SkColorGetR(color) / 255.0f
128 green:SkColorGetG(color) / 255.0f
129 blue:SkColorGetB(color) / 255.0f
130 alpha:alpha];
Justin Novosad 2015/10/30 18:18:13 SkColor stores an alpha value, which this method c
justincohen 2015/10/30 19:43:24 Probably not -- changed to use |color|'s alpha ins
131 }
132
126 } // namespace gfx 133 } // namespace gfx
OLDNEW
« skia/ext/skia_utils_ios.h ('K') | « skia/ext/skia_utils_ios.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698