Chromium Code Reviews| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 */ | 313 */ |
| 314 sk_sp<SkImage> makeSubset(const SkIRect& subset) const; | 314 sk_sp<SkImage> makeSubset(const SkIRect& subset) const; |
| 315 | 315 |
| 316 /** | 316 /** |
| 317 * Ensures that an image is backed by a texture (when GrContext is non-null ). If no | 317 * Ensures that an image is backed by a texture (when GrContext is non-null ). If no |
| 318 * transformation is required, the returned image may be the same as this i mage. If the this | 318 * transformation is required, the returned image may be the same as this i mage. If the this |
| 319 * image is from a different GrContext, this will fail. | 319 * image is from a different GrContext, this will fail. |
| 320 */ | 320 */ |
| 321 sk_sp<SkImage> makeTextureImage(GrContext*) const; | 321 sk_sp<SkImage> makeTextureImage(GrContext*) const; |
| 322 | 322 |
| 323 /** | |
| 324 * Apply a given image filter to this image, and return the filtered result . | |
| 325 * | |
| 326 * The subset represents the active portion of this image. The return value is similarly an | |
| 327 * Skimage, with an active subset (outSubset). This is usually used with te xture-backed | |
| 328 * images, where the texture may be approx-match and thus larger than the r equired size. | |
| 329 * | |
|
robertphillips
2016/05/19 16:35:19
Doesn't clipBounds also capture the position - not
Stephen White
2016/05/19 17:31:26
Fixed.
| |
| 330 * clipBounds represents the maximum size of the image which may be produce d. | |
| 331 * | |
| 332 * offset is the amount to translate the resulting image relative to the sr c when it is drawn. | |
| 333 * This is an out-param. | |
| 334 * | |
| 335 * If the result image cannot be created, or the result would be transparen t black, null | |
|
robertphillips
2016/05/19 16:35:19
subset -> outSubset ?
Stephen White
2016/05/19 17:31:26
Done.
| |
| 336 * is returned, in which case the offset and subset parameters should be ig nored by the caller. | |
| 337 */ | |
| 338 sk_sp<SkImage> makeWithFilter(const SkImageFilter* filter, const SkIRect& su bset, | |
| 339 const SkIRect& clipBounds, SkIRect* outSubset, | |
| 340 SkIPoint* offset); | |
| 341 | |
| 323 /** Drawing params for which a deferred texture image data should be optimiz ed. */ | 342 /** Drawing params for which a deferred texture image data should be optimiz ed. */ |
| 324 struct DeferredTextureImageUsageParams { | 343 struct DeferredTextureImageUsageParams { |
| 325 SkMatrix fMatrix; | 344 SkMatrix fMatrix; |
| 326 SkFilterQuality fQuality; | 345 SkFilterQuality fQuality; |
| 327 }; | 346 }; |
| 328 | 347 |
| 329 /** | 348 /** |
| 330 * This method allows clients to capture the data necessary to turn a SkImag e into a texture- | 349 * This method allows clients to capture the data necessary to turn a SkImag e into a texture- |
| 331 * backed image. If the original image is codec-backed this will decode into a format optimized | 350 * backed image. If the original image is codec-backed this will decode into a format optimized |
| 332 * for the context represented by the proxy. This method is thread safe with respect to the | 351 * for the context represented by the proxy. This method is thread safe with respect to the |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 | 442 |
| 424 private: | 443 private: |
| 425 const int fWidth; | 444 const int fWidth; |
| 426 const int fHeight; | 445 const int fHeight; |
| 427 const uint32_t fUniqueID; | 446 const uint32_t fUniqueID; |
| 428 | 447 |
| 429 typedef SkRefCnt INHERITED; | 448 typedef SkRefCnt INHERITED; |
| 430 }; | 449 }; |
| 431 | 450 |
| 432 #endif | 451 #endif |
| OLD | NEW |