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

Side by Side Diff: ui/gfx/image/image_skia.h

Issue 263253003: Allows arbitrary scale factor in ImageSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/extension_icon_image_unittest.cc ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_H_ 5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_H_
6 #define UI_GFX_IMAGE_IMAGE_SKIA_H_ 6 #define UI_GFX_IMAGE_IMAGE_SKIA_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Returns the maximum scale supported by this platform. 71 // Returns the maximum scale supported by this platform.
72 static float GetMaxSupportedScale(); 72 static float GetMaxSupportedScale();
73 73
74 // Creates an image from the passed in bitmap. 74 // Creates an image from the passed in bitmap.
75 // DIP width and height are based on scale factor of 1x. 75 // DIP width and height are based on scale factor of 1x.
76 // Adds ref to passed in bitmap. 76 // Adds ref to passed in bitmap.
77 // WARNING: The resulting image will be pixelated when painted on a high 77 // WARNING: The resulting image will be pixelated when painted on a high
78 // density display. 78 // density display.
79 static ImageSkia CreateFrom1xBitmap(const SkBitmap& bitmap); 79 static ImageSkia CreateFrom1xBitmap(const SkBitmap& bitmap);
80 80
81 // Returns true when ImageSkia looks up the resource pack with the closest
82 // scale factor and rescale the fetched image.
83 static bool IsDSFScalingInImageSkiaEnabled();
84
81 // Returns a deep copy of this ImageSkia which has its own storage with 85 // Returns a deep copy of this ImageSkia which has its own storage with
82 // the ImageSkiaRep instances that this ImageSkia currently has. 86 // the ImageSkiaRep instances that this ImageSkia currently has.
83 // This can be safely passed to and manipulated by another thread. 87 // This can be safely passed to and manipulated by another thread.
84 // Note that this does NOT generate ImageSkiaReps from its source. 88 // Note that this does NOT generate ImageSkiaReps from its source.
85 // If you want to create a deep copy with ImageSkiaReps for supported 89 // If you want to create a deep copy with ImageSkiaReps for supported
86 // scale factors, you need to explicitly call 90 // scale factors, you need to explicitly call
87 // |EnsureRepsForSupportedScales()| first. 91 // |EnsureRepsForSupportedScales()| first.
88 scoped_ptr<ImageSkia> DeepCopy() const; 92 scoped_ptr<ImageSkia> DeepCopy() const;
89 93
90 // Returns true if this object is backed by the same ImageSkiaStorage as 94 // Returns true if this object is backed by the same ImageSkiaStorage as
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // so that other thread can access the storage. 170 // so that other thread can access the storage.
167 void DetachStorageFromThread(); 171 void DetachStorageFromThread();
168 172
169 // A refptr so that ImageRepSkia can be copied cheaply. 173 // A refptr so that ImageRepSkia can be copied cheaply.
170 scoped_refptr<internal::ImageSkiaStorage> storage_; 174 scoped_refptr<internal::ImageSkiaStorage> storage_;
171 }; 175 };
172 176
173 } // namespace gfx 177 } // namespace gfx
174 178
175 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ 179 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_icon_image_unittest.cc ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698