| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 * Return the GrTexture that stores the image pixels. Calling getTexture | 55 * Return the GrTexture that stores the image pixels. Calling getTexture |
| 56 * does not affect the reference count of the GrTexture object. | 56 * does not affect the reference count of the GrTexture object. |
| 57 * Will return NULL if the image does not use a texture. | 57 * Will return NULL if the image does not use a texture. |
| 58 */ | 58 */ |
| 59 GrTexture* getTexture(); | 59 GrTexture* getTexture(); |
| 60 | 60 |
| 61 virtual SkShader* newShader(SkShader::TileMode, | 61 virtual SkShader* newShader(SkShader::TileMode, |
| 62 SkShader::TileMode, | 62 SkShader::TileMode, |
| 63 const SkMatrix* localMatrix = NULL) const; | 63 const SkMatrix* localMatrix = NULL) const; |
| 64 | 64 |
| 65 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*); | 65 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const; |
| 66 | 66 |
| 67 /** | 67 /** |
| 68 * Draw the image, cropped to the src rect, to the dst rect of a canvas. | 68 * Draw the image, cropped to the src rect, to the dst rect of a canvas. |
| 69 * If src is larger than the bounds of the image, the rest of the image is | 69 * If src is larger than the bounds of the image, the rest of the image is |
| 70 * filled with transparent black pixels. | 70 * filled with transparent black pixels. |
| 71 * | 71 * |
| 72 * See SkCanvas::drawBitmapRectToRect for similar behavior. | 72 * See SkCanvas::drawBitmapRectToRect for similar behavior. |
| 73 */ | 73 */ |
| 74 void draw(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*); | 74 void draw(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*) c
onst; |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * If the image has direct access to its pixels (i.e. they are in local | 77 * If the image has direct access to its pixels (i.e. they are in local |
| 78 * RAM) return the (const) address of those pixels, and if not null, return | 78 * RAM) return the (const) address of those pixels, and if not null, return |
| 79 * the ImageInfo and rowBytes. The returned address is only valid while | 79 * the ImageInfo and rowBytes. The returned address is only valid while |
| 80 * the image object is in scope. | 80 * the image object is in scope. |
| 81 * | 81 * |
| 82 * On failure, returns NULL and the info and rowBytes parameters are | 82 * On failure, returns NULL and the info and rowBytes parameters are |
| 83 * ignored. | 83 * ignored. |
| 84 */ | 84 */ |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 * On failure, false will be returned, and bitmap will unmodified. | 131 * On failure, false will be returned, and bitmap will unmodified. |
| 132 */ | 132 */ |
| 133 // On ice for now: | 133 // On ice for now: |
| 134 // - should it respect the particular colortype/alphatype of the src | 134 // - should it respect the particular colortype/alphatype of the src |
| 135 // - should it have separate entrypoints for preallocated and not bitmaps? | 135 // - should it have separate entrypoints for preallocated and not bitmaps? |
| 136 // - 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? |
| 137 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; | 137 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 #endif | 140 #endif |
| OLD | NEW |