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

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

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 3 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_png_rep.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 4bc21f877cdcfb1df42956b45ab48e3388bd0d91..ec3e65a5998f0cd0674be843d2d2dbdee717ad8b 100644
--- a/ui/gfx/image/image_skia.h
+++ b/ui/gfx/image/image_skia.h
@@ -47,9 +47,9 @@ class UI_EXPORT ImageSkia {
ImageSkia(ImageSkiaSource* source, const gfx::Size& size);
// Creates an instance that uses the |source|. The constructor loads the image
- // at |scale_factor| and uses its dimensions to calculate the size in DIP.
- // ImageSkia owns |source|.
- ImageSkia(ImageSkiaSource* source, ui::ScaleFactor scale_factor);
+ // at |scale| and uses its dimensions to calculate the size in DIP. ImageSkia
+ // owns |source|.
+ ImageSkia(ImageSkiaSource* source, float scale);
explicit ImageSkia(const gfx::ImageSkiaRep& image_rep);
@@ -61,6 +61,16 @@ class UI_EXPORT ImageSkia {
~ImageSkia();
+ // Changes the value of GetSupportedScales() to |scales|.
+ static void SetSupportedScales(const std::vector<float>& scales);
+
+ // Returns a vector with the scale factors which are supported by this
+ // platform, in ascending order.
+ static const std::vector<float>& GetSupportedScales();
+
+ // Returns the maximum scale supported by this platform.
+ static float GetMaxSupportedScale();
+
// Creates an image from the passed in bitmap.
// DIP width and height are based on scale factor of 1x.
// Adds ref to passed in bitmap.
@@ -74,7 +84,7 @@ class UI_EXPORT ImageSkia {
// Note that this does NOT generate ImageSkiaReps from its source.
// If you want to create a deep copy with ImageSkiaReps for supported
// scale factors, you need to explicitly call
- // |EnsureRepsForSupportedScaleFactors()| first.
+ // |EnsureRepsForSupportedScales()| first.
scoped_ptr<ImageSkia> DeepCopy() const;
// Returns true if this object is backed by the same ImageSkiaStorage as
@@ -84,18 +94,16 @@ class UI_EXPORT ImageSkia {
// Adds |image_rep| to the image reps contained by this object.
void AddRepresentation(const gfx::ImageSkiaRep& image_rep);
- // Removes the image rep of |scale_factor| if present.
- void RemoveRepresentation(ui::ScaleFactor scale_factor);
+ // Removes the image rep of |scale| if present.
+ void RemoveRepresentation(float scale);
// Returns true if the object owns an image rep whose density matches
- // |scale_factor| exactly.
- bool HasRepresentation(ui::ScaleFactor scale_factor) const;
+ // |scale| exactly.
+ bool HasRepresentation(float scale) const;
- // Returns the image rep whose density best matches
- // |scale_factor|.
+ // Returns the image rep whose density best matches |scale|.
// Returns a null image rep if the object contains no image reps.
- const gfx::ImageSkiaRep& GetRepresentation(
- ui::ScaleFactor scale_factor) const;
+ const gfx::ImageSkiaRep& GetRepresentation(float scale) const;
// Make the ImageSkia instance read-only. Note that this only prevent
// modification from client code, and the storage may still be
@@ -136,7 +144,7 @@ class UI_EXPORT ImageSkia {
// When the source is available, generates all ImageReps for
// supported scale factors. This method is defined as const as
// the state change in the storage is agnostic to the caller.
- void EnsureRepsForSupportedScaleFactors() const;
+ void EnsureRepsForSupportedScales() const;
private:
friend class test::TestOnThread;
« no previous file with comments | « ui/gfx/image/image_png_rep.cc ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698