Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
| OLD | NEW |