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

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: Fix nits for unit test 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
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* UIColorFromSkColor(SkColor color) {
127 return [UIColor colorWithRed:SkColorGetR(color) / 255.0f
128 green:SkColorGetG(color) / 255.0f
129 blue:SkColorGetB(color) / 255.0f
130 alpha:SkColorGetA(color) / 255.0f];
131 }
132
126 } // namespace gfx 133 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698