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

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

Issue 11028064: Resize images for hi-dpi based on a custom PNG chunk added by GRIT r78, and roll GRIT r78 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 2 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
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 27 matching lines...) Expand all
38 typedef std::vector<ImageSkiaRep> ImageSkiaReps; 38 typedef std::vector<ImageSkiaRep> ImageSkiaReps;
39 39
40 // Creates an instance with no bitmaps. 40 // Creates an instance with no bitmaps.
41 ImageSkia(); 41 ImageSkia();
42 42
43 // Creates an instance that will use the |source| to get the image 43 // Creates an instance that will use the |source| to get the image
44 // for scale factors. |size| specifes the size of the image in DIP. 44 // for scale factors. |size| specifes the size of the image in DIP.
45 // ImageSkia owns |source|. 45 // ImageSkia owns |source|.
46 ImageSkia(ImageSkiaSource* source, const gfx::Size& size); 46 ImageSkia(ImageSkiaSource* source, const gfx::Size& size);
47 47
48 // Creates an instance that uses the |source|. The constructor loads the image
49 // at |scale_factor| and uses its dimensions to calculate the size in DIP.
50 // ImageSkia owns |source|.
51 ImageSkia(ImageSkiaSource* source, ui::ScaleFactor scale_factor);
52
48 // Adds ref to passed in bitmap. 53 // Adds ref to passed in bitmap.
49 // DIP width and height are set based on scale factor of 1x. 54 // DIP width and height are set based on scale factor of 1x.
50 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is 55 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is
51 // done. 56 // done.
52 ImageSkia(const SkBitmap& bitmap); 57 ImageSkia(const SkBitmap& bitmap);
53 58
54 explicit ImageSkia(const gfx::ImageSkiaRep& image_rep); 59 explicit ImageSkia(const gfx::ImageSkiaRep& image_rep);
55 60
56 // Copies a reference to |other|'s storage. 61 // Copies a reference to |other|'s storage.
57 ImageSkia(const ImageSkia& other); 62 ImageSkia(const ImageSkia& other);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // so that other thread can access the storage. 163 // so that other thread can access the storage.
159 void DetachStorageFromThread(); 164 void DetachStorageFromThread();
160 165
161 // A refptr so that ImageRepSkia can be copied cheaply. 166 // A refptr so that ImageRepSkia can be copied cheaply.
162 scoped_refptr<internal::ImageSkiaStorage> storage_; 167 scoped_refptr<internal::ImageSkiaStorage> storage_;
163 }; 168 };
164 169
165 } // namespace gfx 170 } // namespace gfx
166 171
167 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ 172 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698