Chromium Code Reviews| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 // Used by computeResamplingMode to tell how bitmaps should be resampled. | 55 // Used by computeResamplingMode to tell how bitmaps should be resampled. |
| 56 enum ResamplingMode { | 56 enum ResamplingMode { |
| 57 // Nearest neighbor resampling. Used when we detect that the page is | 57 // Nearest neighbor resampling. Used when we detect that the page is |
| 58 // trying to make a pattern by stretching a small bitmap very large. | 58 // trying to make a pattern by stretching a small bitmap very large. |
| 59 NoResampling, | 59 NoResampling, |
| 60 | 60 |
| 61 // Default skia resampling. Used for large growing of images where high | 61 // Default skia resampling. Used for large growing of images where high |
| 62 // quality resampling doesn't get us very much except a slowdown. | 62 // quality resampling doesn't get us very much except a slowdown. |
| 63 LinearResampling, | 63 LinearResampling, |
| 64 | 64 |
| 65 // LinearResampling for upscaling. Mipmapping for downscaling. | |
| 66 MediumResampling, | |
|
Stephen White
2014/03/18 17:26:43
Bikeshed: maybe this should be LinearMipmaps or Li
Alpha Left Google
2014/03/18 22:59:13
Done.
| |
| 67 | |
| 65 // High quality resampling. | 68 // High quality resampling. |
| 66 AwesomeResampling, | 69 AwesomeResampling, |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 // This object is used as the "native image" in our port. When WebKit uses | 72 // This object is used as the "native image" in our port. When WebKit uses |
| 70 // PassNativeImagePtr / NativeImagePtr, it is a smart pointer to this type. | 73 // PassNativeImagePtr / NativeImagePtr, it is a smart pointer to this type. |
| 71 // It has an SkBitmap, and also stores a cached resized image. | 74 // It has an SkBitmap, and also stores a cached resized image. |
| 72 class PLATFORM_EXPORT NativeImageSkia : public RefCounted<NativeImageSkia> { | 75 class PLATFORM_EXPORT NativeImageSkia : public RefCounted<NativeImageSkia> { |
| 73 public: | 76 public: |
| 74 static PassRefPtr<NativeImageSkia> create() | 77 static PassRefPtr<NativeImageSkia> create() |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 // those requests individually are small and would not otherwise be cached. | 199 // those requests individually are small and would not otherwise be cached. |
| 197 // | 200 // |
| 198 // We also track scaling information and destination subset for the scaled | 201 // We also track scaling information and destination subset for the scaled |
| 199 // image. See comments for ImageResourceInfo. | 202 // image. See comments for ImageResourceInfo. |
| 200 mutable ImageResourceInfo m_cachedImageInfo; | 203 mutable ImageResourceInfo m_cachedImageInfo; |
| 201 mutable int m_resizeRequests; | 204 mutable int m_resizeRequests; |
| 202 }; | 205 }; |
| 203 | 206 |
| 204 } | 207 } |
| 205 #endif // NativeImageSkia_h | 208 #endif // NativeImageSkia_h |
| OLD | NEW |