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 /** | 389 /** |
390 * Attempt to create a bitmap with the same pixels as the image. The result
will always be | 390 * Attempt to create a bitmap with the same pixels as the image. The result
will always be |
391 * a raster-backed bitmap (texture-backed bitmaps are DEPRECATED, and not s
upported here). | 391 * a raster-backed bitmap (texture-backed bitmaps are DEPRECATED, and not s
upported here). |
392 * | 392 * |
393 * If the mode is kRO (read-only), the resulting bitmap will be marked as i
mmutable. | 393 * If the mode is kRO (read-only), the resulting bitmap will be marked as i
mmutable. |
394 * | 394 * |
395 * On succcess, returns true. On failure, returns false and the bitmap para
meter will be reset | 395 * On succcess, returns true. On failure, returns false and the bitmap para
meter will be reset |
396 * to empty. | 396 * to empty. |
397 */ | 397 */ |
398 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 398 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
399 | 399 |
400 /** | 400 /** |
401 * Returns true if the image is backed by an image-generator or other src t
hat creates | 401 * Returns true if the image is backed by an image-generator or other src t
hat creates |
402 * (and caches) its pixels / texture on-demand. | 402 * (and caches) its pixels / texture on-demand. |
403 */ | 403 */ |
404 bool isLazyGenerated() const; | 404 bool isLazyGenerated() const; |
405 | 405 |
406 | 406 |
407 #ifdef SK_SUPPORT_LEGACY_IMAGEFACTORY | 407 #ifdef SK_SUPPORT_LEGACY_IMAGEFACTORY |
408 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es, | 408 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es, |
409 SkColorTable* ctable = nullptr); | 409 SkColorTable* ctable = nullptr); |
(...skipping 26 matching lines...) Expand all Loading... |
436 static SkImage* NewFromDeferredTextureImageData(GrContext*, const void*, SkB
udgeted); | 436 static SkImage* NewFromDeferredTextureImageData(GrContext*, const void*, SkB
udgeted); |
437 | 437 |
438 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su
bset).release(); } | 438 SkImage* newSubset(const SkIRect& subset) const { return this->makeSubset(su
bset).release(); } |
439 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma
ge(ctx).release(); } | 439 SkImage* newTextureImage(GrContext* ctx) const { return this->makeTextureIma
ge(ctx).release(); } |
440 #endif | 440 #endif |
441 | 441 |
442 protected: | 442 protected: |
443 SkImage(int width, int height, uint32_t uniqueID); | 443 SkImage(int width, int height, uint32_t uniqueID); |
444 | 444 |
445 private: | 445 private: |
| 446 static sk_sp<SkImage> MakeTextureFromMipMap(GrContext*, const SkImageInfo&, |
| 447 const GrMipLevel* texels, int mi
pLevelCount, |
| 448 SkBudgeted); |
| 449 |
446 const int fWidth; | 450 const int fWidth; |
447 const int fHeight; | 451 const int fHeight; |
448 const uint32_t fUniqueID; | 452 const uint32_t fUniqueID; |
449 | 453 |
450 typedef SkRefCnt INHERITED; | 454 typedef SkRefCnt INHERITED; |
451 }; | 455 }; |
452 | 456 |
453 #endif | 457 #endif |
OLD | NEW |