| 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 29 matching lines...) Expand all Loading... |
| 40 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); | 40 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); |
| 41 static SkImage* NewEncodedData(SkData*); | 41 static SkImage* NewEncodedData(SkData*); |
| 42 | 42 |
| 43 /** | 43 /** |
| 44 * GrTexture is a more logical parameter for this factory, but its | 44 * GrTexture is a more logical parameter for this factory, but its |
| 45 * interactions with scratch cache still has issues, so for now we take | 45 * interactions with scratch cache still has issues, so for now we take |
| 46 * SkBitmap instead. This will be changed in the future. skbug.com/1449 | 46 * SkBitmap instead. This will be changed in the future. skbug.com/1449 |
| 47 */ | 47 */ |
| 48 static SkImage* NewTexture(const SkBitmap&); | 48 static SkImage* NewTexture(const SkBitmap&); |
| 49 | 49 |
| 50 virtual bool isOpaque() const { return false; } |
| 51 |
| 50 int width() const { return fWidth; } | 52 int width() const { return fWidth; } |
| 51 int height() const { return fHeight; } | 53 int height() const { return fHeight; } |
| 52 uint32_t uniqueID() const { return fUniqueID; } | 54 uint32_t uniqueID() const { return fUniqueID; } |
| 53 | 55 |
| 54 /** | 56 /** |
| 55 * Return the GrTexture that stores the image pixels. Calling getTexture | 57 * Return the GrTexture that stores the image pixels. Calling getTexture |
| 56 * does not affect the reference count of the GrTexture object. | 58 * does not affect the reference count of the GrTexture object. |
| 57 * Will return NULL if the image does not use a texture. | 59 * Will return NULL if the image does not use a texture. |
| 58 */ | 60 */ |
| 59 GrTexture* getTexture(); | 61 GrTexture* getTexture(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 * On failure, false will be returned, and bitmap will unmodified. | 131 * On failure, false will be returned, and bitmap will unmodified. |
| 130 */ | 132 */ |
| 131 // On ice for now: | 133 // On ice for now: |
| 132 // - should it respect the particular colortype/alphatype of the src | 134 // - should it respect the particular colortype/alphatype of the src |
| 133 // - should it have separate entrypoints for preallocated and not bitmaps? | 135 // - should it have separate entrypoints for preallocated and not bitmaps? |
| 134 // - isn't it enough to allow the caller to draw() the image into a canvas? | 136 // - isn't it enough to allow the caller to draw() the image into a canvas? |
| 135 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; | 137 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; |
| 136 }; | 138 }; |
| 137 | 139 |
| 138 #endif | 140 #endif |
| OLD | NEW |