| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 * to create deferred texture data for this image (or zero if this is an ina
ppropriate | 389 * to create deferred texture data for this image (or zero if this is an ina
ppropriate |
| 390 * candidate). The buffer allocated by the client should be 8 byte aligned. | 390 * candidate). The buffer allocated by the client should be 8 byte aligned. |
| 391 * | 391 * |
| 392 * When buffer is not null this fills in the deferred texture data for this
image in the | 392 * When buffer is not null this fills in the deferred texture data for this
image in the |
| 393 * provided buffer (assuming this is an appropriate candidate image and the
buffer is | 393 * provided buffer (assuming this is an appropriate candidate image and the
buffer is |
| 394 * appropriately aligned). Upon success the size written is returned, otherw
ise 0. | 394 * appropriately aligned). Upon success the size written is returned, otherw
ise 0. |
| 395 */ | 395 */ |
| 396 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&, | 396 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&, |
| 397 const DeferredTextureImageUsageParams[], | 397 const DeferredTextureImageUsageParams[], |
| 398 int paramCnt, | 398 int paramCnt, |
| 399 void* buffer, | 399 void* buffer) const; |
| 400 SkSourceGammaTreatment treatment = | |
| 401 SkSourceGammaTreatment::kIgnore) const; | |
| 402 | 400 |
| 403 /** | 401 /** |
| 404 * Returns a texture-backed image from data produced in SkImage::getDeferred
TextureImageData. | 402 * Returns a texture-backed image from data produced in SkImage::getDeferred
TextureImageData. |
| 405 * The context must be the context that provided the proxy passed to | 403 * The context must be the context that provided the proxy passed to |
| 406 * getDeferredTextureImageData. | 404 * getDeferredTextureImageData. |
| 407 */ | 405 */ |
| 408 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi
d*, SkBudgeted); | 406 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi
d*, SkBudgeted); |
| 409 | 407 |
| 410 // Helper functions to convert to SkBitmap | 408 // Helper functions to convert to SkBitmap |
| 411 | 409 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su
bset).release(); } | 462 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su
bset).release(); } |
| 465 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma
ge(ctx).release(); } | 463 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma
ge(ctx).release(); } |
| 466 #endif | 464 #endif |
| 467 | 465 |
| 468 protected: | 466 protected: |
| 469 SkImage(int width, int height, uint32_t uniqueID); | 467 SkImage(int width, int height, uint32_t uniqueID); |
| 470 | 468 |
| 471 private: | 469 private: |
| 472 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, | 470 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, |
| 473 const GrMipLevel* texels, int mi
pLevelCount, | 471 const GrMipLevel* texels, int mi
pLevelCount, |
| 474 SkBudgeted, SkSourceGammaTreatme
nt); | 472 SkBudgeted); |
| 475 | 473 |
| 476 const int fWidth; | 474 const int fWidth; |
| 477 const int fHeight; | 475 const int fHeight; |
| 478 const uint32_t fUniqueID; | 476 const uint32_t fUniqueID; |
| 479 | 477 |
| 480 typedef SkRefCnt INHERITED; | 478 typedef SkRefCnt INHERITED; |
| 481 }; | 479 }; |
| 482 | 480 |
| 483 #endif | 481 #endif |
| OLD | NEW |