diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-03 19:35:33 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-03 19:35:33 +0000 |
commit | 6172089d610e92345a897c9bb05f7f8c7279d39b (patch) | |
tree | 9b7ef543a7e62afa06cdc397054c2c75e6dfba34 /ui | |
parent | f4bb9fded21dd5595e4d8da54ad2ab4b91ef7e49 (diff) | |
download | chromium_src-6172089d610e92345a897c9bb05f7f8c7279d39b.zip chromium_src-6172089d610e92345a897c9bb05f7f8c7279d39b.tar.gz chromium_src-6172089d610e92345a897c9bb05f7f8c7279d39b.tar.bz2 |
Change return type of FaviconTabHelper::GetFavicon() to gfx::Image.
No intended behavior change for now.
Depends on http://codereview.chromium.org/10832128/
Part of supporting hidpi favicons in the tab strip.
BUG=138550
TBR=joi
Review URL: https://chromiumcodereview.appspot.com/10837090
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149891 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/image/image.cc | 8 | ||||
-rw-r--r-- | ui/gfx/image/image.h | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc index ea302ab..9854787 100644 --- a/ui/gfx/image/image.cc +++ b/ui/gfx/image/image.cc @@ -337,6 +337,14 @@ NSImage* Image::ToNSImage() const { } #endif +SkBitmap Image::AsBitmap() const { + return IsEmpty() ? SkBitmap() : *ToSkBitmap(); +} + +ImageSkia Image::AsImageSkia() const { + return IsEmpty() ? ImageSkia(SkBitmap()) : *ToImageSkia(); +} + ImageSkia* Image::CopyImageSkia() const { return new ImageSkia(*ToImageSkia()); } diff --git a/ui/gfx/image/image.h b/ui/gfx/image/image.h index c03db3a..04a79da 100644 --- a/ui/gfx/image/image.h +++ b/ui/gfx/image/image.h @@ -107,6 +107,13 @@ class UI_EXPORT Image { NSImage* ToNSImage() const; #endif + // Same as ToSkBitmap(), but returns a null SkBitmap if this image is empty. + SkBitmap AsBitmap() const; + + // Same as ToSkBitmap(), but returns a ImageSkia with a null SkBitmap if this + // image is empty. + ImageSkia AsImageSkia() const; + // Performs a conversion, like above, but returns a copy of the result rather // than a weak pointer. The caller is responsible for deleting the result. // Note that the result is only a copy in terms of memory management; the |