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

Unified Diff: ui/gfx/image/image.cc

Issue 9455062: Add gfx::Image::Image(const SkBitmap&) constructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/image/image.h ('k') | ui/gfx/image/image_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image.cc
diff --git a/ui/gfx/image/image.cc b/ui/gfx/image/image.cc
index 61a84e74ec3278dbb8beea5f0909c5cb7d7619e5..e2eeadfec11382d00db8990cc9436b35ec778d4f 100644
--- a/ui/gfx/image/image.cc
+++ b/ui/gfx/image/image.cc
@@ -243,6 +243,13 @@ Image::Image(const SkBitmap* bitmap)
AddRepresentation(rep);
}
+Image::Image(const SkBitmap& bitmap)
+ : storage_(new internal::ImageStorage(Image::kImageRepSkia)) {
+ internal::ImageRepSkia* rep =
+ new internal::ImageRepSkia(new SkBitmap(bitmap));
+ AddRepresentation(rep);
+}
+
Image::Image(const std::vector<const SkBitmap*>& bitmaps)
: storage_(new internal::ImageStorage(Image::kImageRepSkia)) {
internal::ImageRepSkia* rep = new internal::ImageRepSkia(bitmaps);
« no previous file with comments | « ui/gfx/image/image.h ('k') | ui/gfx/image/image_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698