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

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

Issue 2902153002: arc: Support non-standard display scale factors. (Closed)
Patch Set: comment updated Created 3 years, 6 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
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_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 <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // Changes the value of GetSupportedScales() to |scales|. 68 // Changes the value of GetSupportedScales() to |scales|.
69 static void SetSupportedScales(const std::vector<float>& scales); 69 static void SetSupportedScales(const std::vector<float>& scales);
70 70
71 // Returns a vector with the scale factors which are supported by this 71 // Returns a vector with the scale factors which are supported by this
72 // platform, in ascending order. 72 // platform, in ascending order.
73 static const std::vector<float>& GetSupportedScales(); 73 static const std::vector<float>& GetSupportedScales();
74 74
75 // Returns the maximum scale supported by this platform. 75 // Returns the maximum scale supported by this platform.
76 static float GetMaxSupportedScale(); 76 static float GetMaxSupportedScale();
77 77
78 // Maps to closest supported scale.
msw 2017/05/24 20:27:59 nit: "Maps |scale| to the closest supported scale.
khmel 2017/05/24 21:32:37 Done.
79 static float MapToSupportedScale(float scale);
80
78 // Creates an image from the passed in bitmap. 81 // Creates an image from the passed in bitmap.
79 // DIP width and height are based on scale factor of 1x. 82 // DIP width and height are based on scale factor of 1x.
80 // Adds ref to passed in bitmap. 83 // Adds ref to passed in bitmap.
81 // WARNING: The resulting image will be pixelated when painted on a high 84 // WARNING: The resulting image will be pixelated when painted on a high
82 // density display. 85 // density display.
83 static ImageSkia CreateFrom1xBitmap(const SkBitmap& bitmap); 86 static ImageSkia CreateFrom1xBitmap(const SkBitmap& bitmap);
84 87
85 // Returns a deep copy of this ImageSkia which has its own storage with 88 // Returns a deep copy of this ImageSkia which has its own storage with
86 // the ImageSkiaRep instances that this ImageSkia currently has. 89 // the ImageSkiaRep instances that this ImageSkia currently has.
87 // This can be safely passed to and manipulated by another thread. 90 // This can be safely passed to and manipulated by another thread.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // so that other thread can access the storage. 173 // so that other thread can access the storage.
171 void DetachStorageFromThread(); 174 void DetachStorageFromThread();
172 175
173 // A refptr so that ImageRepSkia can be copied cheaply. 176 // A refptr so that ImageRepSkia can be copied cheaply.
174 scoped_refptr<internal::ImageSkiaStorage> storage_; 177 scoped_refptr<internal::ImageSkiaStorage> storage_;
175 }; 178 };
176 179
177 } // namespace gfx 180 } // namespace gfx
178 181
179 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ 182 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_unittest.cc ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698