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

Side by Side Diff: ui/gfx/image/image_unittest_util.cc

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/image/image_skia_util_ios.mm ('k') | ui/gfx/image/image_unittest_util_ios.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // Because the unit tests for gfx::Image are spread across multiple 5 // Because the unit tests for gfx::Image are spread across multiple
6 // implementation files, this header contains the reusable components. 6 // implementation files, this header contains the reusable components.
7 7
8 #include "ui/gfx/image/image_unittest_util.h" 8 #include "ui/gfx/image/image_unittest_util.h"
9 9
10 #include <cmath> 10 #include <cmath>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 return bmp.isNull() || 179 return bmp.isNull() ||
180 (bmp.width() == 0 && bmp.height() == 0); 180 (bmp.width() == 0 && bmp.height() == 0);
181 } 181 }
182 182
183 PlatformImage CreatePlatformImage() { 183 PlatformImage CreatePlatformImage() {
184 const SkBitmap bitmap(CreateBitmap(25, 25)); 184 const SkBitmap bitmap(CreateBitmap(25, 25));
185 #if defined(OS_IOS) 185 #if defined(OS_IOS)
186 ui::ScaleFactor scale_factor = ui::GetMaxScaleFactor(); 186 ui::ScaleFactor scale_factor = ui::GetMaxScaleFactor();
187 float scale = ui::GetScaleFactorScale(scale_factor); 187 float scale = ui::GetScaleFactorScale(scale_factor);
188 188
189 base::mac::ScopedCFTypeRef<CGColorSpaceRef> color_space( 189 base::ScopedCFTypeRef<CGColorSpaceRef> color_space(
190 CGColorSpaceCreateDeviceRGB()); 190 CGColorSpaceCreateDeviceRGB());
191 UIImage* image = 191 UIImage* image =
192 gfx::SkBitmapToUIImageWithColorSpace(bitmap, scale, color_space); 192 gfx::SkBitmapToUIImageWithColorSpace(bitmap, scale, color_space);
193 base::mac::NSObjectRetain(image); 193 base::mac::NSObjectRetain(image);
194 return image; 194 return image;
195 #elif defined(OS_MACOSX) 195 #elif defined(OS_MACOSX)
196 NSImage* image = gfx::SkBitmapToNSImage(bitmap); 196 NSImage* image = gfx::SkBitmapToNSImage(bitmap);
197 base::mac::NSObjectRetain(image); 197 base::mac::NSObjectRetain(image);
198 return image; 198 return image;
199 #elif defined(TOOLKIT_GTK) 199 #elif defined(TOOLKIT_GTK)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 bool PlatformImagesEqual(PlatformImage image1, PlatformImage image2) { 278 bool PlatformImagesEqual(PlatformImage image1, PlatformImage image2) {
279 #if defined(OS_MACOSX) || defined(TOOLKIT_GTK) 279 #if defined(OS_MACOSX) || defined(TOOLKIT_GTK)
280 return image1 == image2; 280 return image1 == image2;
281 #else 281 #else
282 return image1.BackedBySameObjectAs(image2); 282 return image1.BackedBySameObjectAs(image2);
283 #endif 283 #endif
284 } 284 }
285 285
286 } // namespace test 286 } // namespace test
287 } // namespace gfx 287 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image_skia_util_ios.mm ('k') | ui/gfx/image/image_unittest_util_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698