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

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

Issue 10780010: Introduces ImageSkia::GetRepresentations() for Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/web_applications/web_app_mac.mm ('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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // Returns true if the object owns an image rep whose density matches 76 // Returns true if the object owns an image rep whose density matches
77 // |scale_factor| exactly. 77 // |scale_factor| exactly.
78 bool HasRepresentation(ui::ScaleFactor scale_factor) const; 78 bool HasRepresentation(ui::ScaleFactor scale_factor) const;
79 79
80 // Returns the image rep whose density best matches 80 // Returns the image rep whose density best matches
81 // |scale_factor|. 81 // |scale_factor|.
82 // Returns a null image rep if the object contains no image reps. 82 // Returns a null image rep if the object contains no image reps.
83 const gfx::ImageSkiaRep& GetRepresentation( 83 const gfx::ImageSkiaRep& GetRepresentation(
84 ui::ScaleFactor scale_factor) const; 84 ui::ScaleFactor scale_factor) const;
85 85
86 #if defined(OS_MACOSX)
87 // Returns the image reps contained by this object.
88 // If the image has a source, this method will attempt to generate
89 // representations from the source for all supported scale factors.
90 // Mac only for now.
91 std::vector<ImageSkiaRep> GetRepresentations() const;
92 #endif // OS_MACOSX
93
86 // Returns true if object is null or its size is empty. 94 // Returns true if object is null or its size is empty.
87 bool empty() const; 95 bool empty() const;
88 96
89 // Returns true if this is a null object. 97 // Returns true if this is a null object.
90 // TODO(pkotwicz): Merge this function into empty(). 98 // TODO(pkotwicz): Merge this function into empty().
91 bool isNull() const { return storage_ == NULL; } 99 bool isNull() const { return storage_ == NULL; }
92 100
93 // Width and height of image in DIP coordinate system. 101 // Width and height of image in DIP coordinate system.
94 int width() const; 102 int width() const;
95 int height() const; 103 int height() const;
(...skipping 25 matching lines...) Expand all
121 // If the image rep's bitmap is empty, ImageStorage is set to NULL. 129 // If the image rep's bitmap is empty, ImageStorage is set to NULL.
122 void Init(const gfx::ImageSkiaRep& image_rep); 130 void Init(const gfx::ImageSkiaRep& image_rep);
123 131
124 // A refptr so that ImageRepSkia can be copied cheaply. 132 // A refptr so that ImageRepSkia can be copied cheaply.
125 scoped_refptr<internal::ImageSkiaStorage> storage_; 133 scoped_refptr<internal::ImageSkiaStorage> storage_;
126 }; 134 };
127 135
128 } // namespace gfx 136 } // namespace gfx
129 137
130 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ 138 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_
OLDNEW
« no previous file with comments | « chrome/browser/web_applications/web_app_mac.mm ('k') | ui/gfx/image/image_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698