| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
| 9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
| 10 | 10 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 * to empty. | 317 * to empty. |
| 318 */ | 318 */ |
| 319 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 319 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
| 320 | 320 |
| 321 /** | 321 /** |
| 322 * Returns true if the image is backed by an image-generator or other src t
hat creates | 322 * Returns true if the image is backed by an image-generator or other src t
hat creates |
| 323 * (and caches) its pixels / texture on-demand. | 323 * (and caches) its pixels / texture on-demand. |
| 324 */ | 324 */ |
| 325 bool isLazyGenerated() const; | 325 bool isLazyGenerated() const; |
| 326 | 326 |
| 327 /** | |
| 328 * Apply the specified filter to this image, and return the result as a new
image. | |
| 329 * | |
| 330 * if forceResultToOriginalSize is true, then the resulting image will be t
he same size as the | |
| 331 * src, regardless of the normal output of the filter. | |
| 332 * | |
| 333 * If offset is non-null, it is set to the relative offset needed to draw t
he resulting image | |
| 334 * in the same logical place as the original. | |
| 335 * | |
| 336 * e.g. | |
| 337 * If the filter makes the result larger by a margin of 4 the output wo
uld be: | |
| 338 * result->width() == this->width + 8 | |
| 339 * result->height() == this->height + 8 | |
| 340 * offset.x() == -4 | |
| 341 * offset.y() == -4 | |
| 342 * | |
| 343 * If the filter fails to create a resulting image, null is returned, and t
he offset parameter | |
| 344 * (if specified) will be undefined. | |
| 345 */ | |
| 346 SkImage* applyFilter(SkImageFilter* filter, SkIPoint* offset, | |
| 347 bool forceResultToOriginalSize) const; | |
| 348 | |
| 349 protected: | 327 protected: |
| 350 SkImage(int width, int height, uint32_t uniqueID); | 328 SkImage(int width, int height, uint32_t uniqueID); |
| 351 | 329 |
| 352 private: | 330 private: |
| 353 const int fWidth; | 331 const int fWidth; |
| 354 const int fHeight; | 332 const int fHeight; |
| 355 const uint32_t fUniqueID; | 333 const uint32_t fUniqueID; |
| 356 | 334 |
| 357 typedef SkRefCnt INHERITED; | 335 typedef SkRefCnt INHERITED; |
| 358 }; | 336 }; |
| 359 | 337 |
| 360 #endif | 338 #endif |
| OLD | NEW |