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

Unified Diff: ui/gfx/image/image_skia.h

Issue 10860004: image-skia: Remove implicit conversion to SkBitmap on linux and chromeos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « content/browser/web_contents/web_contents_drag_win.cc ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia.h
diff --git a/ui/gfx/image/image_skia.h b/ui/gfx/image/image_skia.h
index a32ee9fa9a9634203d560be8756c5709e4a9e876..7c729cb95b0205ce960c5a13b2cdf6b3839e8808 100644
--- a/ui/gfx/image/image_skia.h
+++ b/ui/gfx/image/image_skia.h
@@ -60,10 +60,12 @@ class UI_EXPORT ImageSkia {
// done.
ImageSkia& operator=(const SkBitmap& other);
+#if defined(OS_MACOSX) || defined(OS_WIN)
// Converts to gfx::ImageSkiaRep and SkBitmap.
// TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is
// done.
- operator SkBitmap&() const;
+ operator SkBitmap&() const { return GetBitmap(); }
+#endif
~ImageSkia();
@@ -117,7 +119,7 @@ class UI_EXPORT ImageSkia {
// This function should only be used in unittests and on platforms which do
// not support scale factors other than 1x.
// TODO(pkotwicz): Return null SkBitmap when the object has no 1x bitmap.
- const SkBitmap* bitmap() const { return &operator SkBitmap&(); }
+ const SkBitmap* bitmap() const { return &GetBitmap(); }
// Returns a vector with the image reps contained in this object.
// There is no guarantee that this will return all images rep for
@@ -131,6 +133,8 @@ class UI_EXPORT ImageSkia {
// If the image rep's bitmap is empty, ImageStorage is set to NULL.
void Init(const gfx::ImageSkiaRep& image_rep);
+ SkBitmap& GetBitmap() const;
+
// A refptr so that ImageRepSkia can be copied cheaply.
scoped_refptr<internal::ImageSkiaStorage> storage_;
};
« no previous file with comments | « content/browser/web_contents/web_contents_drag_win.cc ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698