| 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 19 matching lines...) Expand all Loading... |
| 30 * into another canvas. | 30 * into another canvas. |
| 31 * | 31 * |
| 32 * The content of SkImage is always immutable, though the actual storage may | 32 * The content of SkImage is always immutable, though the actual storage may |
| 33 * change, if for example that image can be re-created via encoded data or | 33 * change, if for example that image can be re-created via encoded data or |
| 34 * other means. | 34 * other means. |
| 35 */ | 35 */ |
| 36 class SK_API SkImage : public SkRefCnt { | 36 class SK_API SkImage : public SkRefCnt { |
| 37 public: | 37 public: |
| 38 SK_DECLARE_INST_COUNT(SkImage) | 38 SK_DECLARE_INST_COUNT(SkImage) |
| 39 | 39 |
| 40 #ifdef SK_SUPPORT_LEGACY_COLORTYPE | |
| 41 typedef SkColorType ColorType; | |
| 42 | |
| 43 static const SkColorType kAlpha_8_ColorType = kAlpha_8_SkColorType; | |
| 44 static const SkColorType kARGB_4444_ColorType = kARGB_4444_SkColorType; | |
| 45 static const SkColorType kRGB_565_ColorType = kRGB_565_SkColorType; | |
| 46 static const SkColorType kRGBA_8888_ColorType = kRGBA_8888_SkColorType; | |
| 47 static const SkColorType kBGRA_8888_ColorType = kBGRA_8888_SkColorType; | |
| 48 static const SkColorType kPMColor_ColorType = kPMColor_SkColorType; | |
| 49 static const SkColorType kLastEnum_ColorType = kLastEnum_SkColorType; | |
| 50 #endif | |
| 51 | |
| 52 #ifdef SK_SUPPORT_LEGACY_ALPHATYPE | |
| 53 typedef SkAlphaType AlphaType; | |
| 54 | |
| 55 static const SkAlphaType kIgnore_AlphaType = kIgnore_SkAlphaType; | |
| 56 static const SkAlphaType kOpaque_AlphaType = kOpaque_SkAlphaType; | |
| 57 static const SkAlphaType kPremul_AlphaType = kPremul_SkAlphaType; | |
| 58 static const SkAlphaType kUnpremul_AlphaType = kUnpremul_SkAlphaType; | |
| 59 #endif | |
| 60 | |
| 61 typedef SkImageInfo Info; | 40 typedef SkImageInfo Info; |
| 62 | 41 |
| 63 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); | 42 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt
es); |
| 64 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); | 43 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); |
| 65 static SkImage* NewEncodedData(SkData*); | 44 static SkImage* NewEncodedData(SkData*); |
| 66 | 45 |
| 67 /** | 46 /** |
| 68 * GrTexture is a more logical parameter for this factory, but its | 47 * GrTexture is a more logical parameter for this factory, but its |
| 69 * interactions with scratch cache still has issues, so for now we take | 48 * interactions with scratch cache still has issues, so for now we take |
| 70 * SkBitmap instead. This will be changed in the future. skbug.com/1449 | 49 * SkBitmap instead. This will be changed in the future. skbug.com/1449 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 const int fWidth; | 99 const int fWidth; |
| 121 const int fHeight; | 100 const int fHeight; |
| 122 const uint32_t fUniqueID; | 101 const uint32_t fUniqueID; |
| 123 | 102 |
| 124 static uint32_t NextUniqueID(); | 103 static uint32_t NextUniqueID(); |
| 125 | 104 |
| 126 typedef SkRefCnt INHERITED; | 105 typedef SkRefCnt INHERITED; |
| 127 }; | 106 }; |
| 128 | 107 |
| 129 #endif | 108 #endif |
| OLD | NEW |