mac: Fix SkiaUtilsMacTest.NSImageRepToSkBitmap.
commit842cf8bf97c8c12b64c5c189e2f0781a3330aba8
authorerikchen <erikchen@chromium.org>
Wed, 15 Jul 2015 20:45:01 +0000 (15 13:45 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 15 Jul 2015 20:45:51 +0000 (15 20:45 +0000)
treea79c145596c3f3f243f72d0678c3a69774cee9a4
parentb53d5d2078793f80b78ee4b6229c22fae731add1
mac: Fix SkiaUtilsMacTest.NSImageRepToSkBitmap.

This test used the function CreateNSImage(), which first created an NSImage, and
then attached a NSBitmapImageRep to the NSImage. The problem is that the
NSBitmapImageRep was implicitly created, and its colorspace depended on the
linked version of OSX and hardware on the machine. I changed the implementation
of CreateNSImage() to use an explicitly created NSBitmapImageRep. I also changed
the colorspace of the function CreateNSImage() and the unit test to always be
+[NSColorSpace genericRGBColorSpace], to avoid potential wacky scenarios that
could arise with +[NSColorSpace deviceRGBColorSpace].

BUG=463170

Review URL: https://codereview.chromium.org/1225233004

Cr-Commit-Position: refs/heads/master@{#338909}
skia/ext/skia_utils_mac_unittest.mm