[Mac] Implement ResourceBundle::GetNativeImageNamed() to load directly into an NSImage.
This should have marginal performance gains for Mac. Instead of loading into a
Skia-backed gfx::Image, which then converts to get an NSImage representation,
this will load directly to an NSImage-backed gfx::Image.
BUG=carnitas
TEST=All UI images load and look correct.
Review URL: http://codereview.chromium.org/6543016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75891 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/gfx/image.cc b/ui/gfx/image.cc
index 25eab5b..b73b938 100644
--- a/ui/gfx/image.cc
+++ b/ui/gfx/image.cc
@@ -202,6 +202,10 @@
}
#endif
+bool Image::HasRepresentation(RepresentationType type) {
+ return representations_.count(type) != 0;
+}
+
internal::ImageRep* Image::DefaultRepresentation() {
RepresentationMap::iterator it =
representations_.find(default_representation_);