| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 * to create deferred texture data for this image (or zero if this is an ina
ppropriate | 377 * to create deferred texture data for this image (or zero if this is an ina
ppropriate |
| 378 * candidate). The buffer allocated by the client should be 8 byte aligned. | 378 * candidate). The buffer allocated by the client should be 8 byte aligned. |
| 379 * | 379 * |
| 380 * When buffer is not null this fills in the deferred texture data for this
image in the | 380 * When buffer is not null this fills in the deferred texture data for this
image in the |
| 381 * provided buffer (assuming this is an appropriate candidate image and the
buffer is | 381 * provided buffer (assuming this is an appropriate candidate image and the
buffer is |
| 382 * appropriately aligned). Upon success the size written is returned, otherw
ise 0. | 382 * appropriately aligned). Upon success the size written is returned, otherw
ise 0. |
| 383 */ | 383 */ |
| 384 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&, | 384 size_t getDeferredTextureImageData(const GrContextThreadSafeProxy&, |
| 385 const DeferredTextureImageUsageParams[], | 385 const DeferredTextureImageUsageParams[], |
| 386 int paramCnt, | 386 int paramCnt, |
| 387 void* buffer, | 387 void* buffer) const; |
| 388 SkSourceGammaTreatment treatment = | |
| 389 SkSourceGammaTreatment::kIgnore) const; | |
| 390 | 388 |
| 391 /** | 389 /** |
| 392 * Returns a texture-backed image from data produced in SkImage::getDeferred
TextureImageData. | 390 * Returns a texture-backed image from data produced in SkImage::getDeferred
TextureImageData. |
| 393 * The context must be the context that provided the proxy passed to | 391 * The context must be the context that provided the proxy passed to |
| 394 * getDeferredTextureImageData. | 392 * getDeferredTextureImageData. |
| 395 */ | 393 */ |
| 396 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi
d*, SkBudgeted); | 394 static sk_sp<SkImage> MakeFromDeferredTextureImageData(GrContext*, const voi
d*, SkBudgeted); |
| 397 | 395 |
| 398 // Helper functions to convert to SkBitmap | 396 // Helper functions to convert to SkBitmap |
| 399 | 397 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su
bset).release(); } | 452 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su
bset).release(); } |
| 455 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma
ge(ctx).release(); } | 453 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma
ge(ctx).release(); } |
| 456 #endif | 454 #endif |
| 457 | 455 |
| 458 protected: | 456 protected: |
| 459 SkImage(int width, int height, uint32_t uniqueID); | 457 SkImage(int width, int height, uint32_t uniqueID); |
| 460 | 458 |
| 461 private: | 459 private: |
| 462 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, | 460 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, |
| 463 const GrMipLevel* texels, int mi
pLevelCount, | 461 const GrMipLevel* texels, int mi
pLevelCount, |
| 464 SkBudgeted, SkSourceGammaTreatme
nt); | 462 SkBudgeted); |
| 465 | 463 |
| 466 const int fWidth; | 464 const int fWidth; |
| 467 const int fHeight; | 465 const int fHeight; |
| 468 const uint32_t fUniqueID; | 466 const uint32_t fUniqueID; |
| 469 | 467 |
| 470 typedef SkRefCnt INHERITED; | 468 typedef SkRefCnt INHERITED; |
| 471 }; | 469 }; |
| 472 | 470 |
| 473 #endif | 471 #endif |
| OLD | NEW |