OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // This will return an existing resized image subset, or generate a new one | 95 // This will return an existing resized image subset, or generate a new one |
96 // of the specified size and subset and possibly cache it. | 96 // of the specified size and subset and possibly cache it. |
97 // | 97 // |
98 // scaledImageSize | 98 // scaledImageSize |
99 // Dimensions of the scaled full image. | 99 // Dimensions of the scaled full image. |
100 // | 100 // |
101 // scaledImageSubset | 101 // scaledImageSubset |
102 // Rectangle of the subset in the scaled image. | 102 // Rectangle of the subset in the scaled image. |
103 SkBitmap resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaled
ImageSubset) const; | 103 SkBitmap resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaled
ImageSubset) const; |
104 | 104 |
105 void reportMemoryUsage(MemoryObjectInfo*) const; | |
106 | |
107 private: | 105 private: |
108 NativeImageSkia(); | 106 NativeImageSkia(); |
109 | 107 |
110 NativeImageSkia(const SkBitmap&, float resolutionScale); | 108 NativeImageSkia(const SkBitmap&, float resolutionScale); |
111 | 109 |
112 // CachedImageInfo is used to uniquely identify cached or requested image | 110 // CachedImageInfo is used to uniquely identify cached or requested image |
113 // resizes. | 111 // resizes. |
114 // Image resize is identified by the scaled image size and scaled image subs
et. | 112 // Image resize is identified by the scaled image size and scaled image subs
et. |
115 struct CachedImageInfo { | 113 struct CachedImageInfo { |
116 SkISize scaledImageSize; | 114 SkISize scaledImageSize; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // those requests individually are small and would not otherwise be cached. | 158 // those requests individually are small and would not otherwise be cached. |
161 // | 159 // |
162 // We also track scaling information and destination subset for the scaled | 160 // We also track scaling information and destination subset for the scaled |
163 // image. See comments for CachedImageInfo. | 161 // image. See comments for CachedImageInfo. |
164 mutable CachedImageInfo m_cachedImageInfo; | 162 mutable CachedImageInfo m_cachedImageInfo; |
165 mutable int m_resizeRequests; | 163 mutable int m_resizeRequests; |
166 }; | 164 }; |
167 | 165 |
168 } | 166 } |
169 #endif // NativeImageSkia_h | 167 #endif // NativeImageSkia_h |
OLD | NEW |