Chromium Code Reviews| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 * Will return NULL if the image does not use a texture. | 77 * Will return NULL if the image does not use a texture. |
| 78 */ | 78 */ |
| 79 GrTexture* getTexture(); | 79 GrTexture* getTexture(); |
| 80 | 80 |
| 81 SkShader* newShaderClamp() const; | 81 SkShader* newShaderClamp() const; |
| 82 SkShader* newShader(SkShader::TileMode, SkShader::TileMode) const; | 82 SkShader* newShader(SkShader::TileMode, SkShader::TileMode) const; |
| 83 | 83 |
| 84 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*); | 84 void draw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*); |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Draw the image, cropped to the src rect, to the dst rect of a canvas. | |
| 88 * If src is larger than the bounds of the image, the rest of the image is | |
| 89 * filled with transparent black pixels. | |
|
reed1
2013/07/19 19:32:30
// See SkCanvas::drawBitmapRectToRect for similar
| |
| 90 */ | |
| 91 void draw(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*); | |
| 92 | |
| 93 /** | |
| 87 * Encode the image's pixels and return the result as a new SkData, which | 94 * Encode the image's pixels and return the result as a new SkData, which |
| 88 * the caller must manage (i.e. call unref() when they are done). | 95 * the caller must manage (i.e. call unref() when they are done). |
| 89 * | 96 * |
| 90 * If the image type cannot be encoded, or the requested encoder type is | 97 * If the image type cannot be encoded, or the requested encoder type is |
| 91 * not supported, this will return NULL. | 98 * not supported, this will return NULL. |
| 92 */ | 99 */ |
| 93 SkData* encode(SkImageEncoder::Type t = SkImageEncoder::kPNG_Type, | 100 SkData* encode(SkImageEncoder::Type t = SkImageEncoder::kPNG_Type, |
| 94 int quality = 80) const; | 101 int quality = 80) const; |
| 95 | 102 |
| 96 protected: | 103 protected: |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 107 const int fWidth; | 114 const int fWidth; |
| 108 const int fHeight; | 115 const int fHeight; |
| 109 const uint32_t fUniqueID; | 116 const uint32_t fUniqueID; |
| 110 | 117 |
| 111 static uint32_t NextUniqueID(); | 118 static uint32_t NextUniqueID(); |
| 112 | 119 |
| 113 typedef SkRefCnt INHERITED; | 120 typedef SkRefCnt INHERITED; |
| 114 }; | 121 }; |
| 115 | 122 |
| 116 #endif | 123 #endif |
| OLD | NEW |