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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 int width() const { return fWidth; } | 67 int width() const { return fWidth; } |
68 int height() const { return fHeight; } | 68 int height() const { return fHeight; } |
69 uint32_t uniqueID() const { return fUniqueID; } | 69 uint32_t uniqueID() const { return fUniqueID; } |
70 virtual bool isOpaque() const { return false; } | 70 virtual bool isOpaque() const { return false; } |
71 | 71 |
72 /** | 72 /** |
73 * Return the GrTexture that stores the image pixels. Calling getTexture | 73 * Return the GrTexture that stores the image pixels. Calling getTexture |
74 * does not affect the reference count of the GrTexture object. | 74 * does not affect the reference count of the GrTexture object. |
75 * Will return NULL if the image does not use a texture. | 75 * Will return NULL if the image does not use a texture. |
76 */ | 76 */ |
77 GrTexture* getTexture(); | 77 GrTexture* getTexture() const; |
78 | 78 |
79 virtual SkShader* newShader(SkShader::TileMode, | 79 virtual SkShader* newShader(SkShader::TileMode, |
80 SkShader::TileMode, | 80 SkShader::TileMode, |
81 const SkMatrix* localMatrix = NULL) const; | 81 const SkMatrix* localMatrix = NULL) const; |
82 | 82 |
83 /** | 83 /** |
84 * If the image has direct access to its pixels (i.e. they are in local | 84 * If the image has direct access to its pixels (i.e. they are in local |
85 * RAM) return the (const) address of those pixels, and if not null, return | 85 * RAM) return the (const) address of those pixels, and if not null, return |
86 * the ImageInfo and rowBytes. The returned address is only valid while | 86 * the ImageInfo and rowBytes. The returned address is only valid while |
87 * the image object is in scope. | 87 * the image object is in scope. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 * Draw the image, cropped to the src rect, to the dst rect of a canvas. | 183 * Draw the image, cropped to the src rect, to the dst rect of a canvas. |
184 * If src is larger than the bounds of the image, the rest of the image is | 184 * If src is larger than the bounds of the image, the rest of the image is |
185 * filled with transparent black pixels. | 185 * filled with transparent black pixels. |
186 * | 186 * |
187 * See SkCanvas::drawBitmapRectToRect for similar behavior. | 187 * See SkCanvas::drawBitmapRectToRect for similar behavior. |
188 */ | 188 */ |
189 void drawRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint
*) const; | 189 void drawRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint
*) const; |
190 }; | 190 }; |
191 | 191 |
192 #endif | 192 #endif |
OLD | NEW |