| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "ios/chrome/browser/ui/collection_view/cells/test_utils.h" | 5 #import "ios/chrome/browser/ui/collection_view/cells/test_utils.h" |
| 6 | 6 |
| 7 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 8 #error "This file requires ARC support." |
| 9 #endif |
| 10 |
| 7 namespace ios_internal { | 11 namespace ios_internal { |
| 8 | 12 |
| 9 UIImage* CollectionViewTestImage() { | 13 UIImage* CollectionViewTestImage() { |
| 10 CGRect rect = CGRectMake(0.0, 0.0, 1.0, 1.0); | 14 CGRect rect = CGRectMake(0.0, 0.0, 1.0, 1.0); |
| 11 UIGraphicsBeginImageContext(rect.size); | 15 UIGraphicsBeginImageContext(rect.size); |
| 12 CGContextRef context = UIGraphicsGetCurrentContext(); | 16 CGContextRef context = UIGraphicsGetCurrentContext(); |
| 13 | 17 |
| 14 CGContextSetFillColorWithColor(context, [UIColor blueColor].CGColor); | 18 CGContextSetFillColorWithColor(context, [UIColor blueColor].CGColor); |
| 15 CGContextFillRect(context, rect); | 19 CGContextFillRect(context, rect); |
| 16 | 20 |
| 17 UIImage* image = UIGraphicsGetImageFromCurrentImageContext(); | 21 UIImage* image = UIGraphicsGetImageFromCurrentImageContext(); |
| 18 UIGraphicsEndImageContext(); | 22 UIGraphicsEndImageContext(); |
| 19 | 23 |
| 20 return image; | 24 return image; |
| 21 } | 25 } |
| 22 | 26 |
| 23 } // namespace ios_internal | 27 } // namespace ios_internal |
| OLD | NEW |