OLD | NEW |
1 | 1 |
2 | 2 |
3 /* | 3 /* |
4 * Copyright 2006 The Android Open Source Project | 4 * Copyright 2006 The Android Open Source Project |
5 * | 5 * |
6 * Use of this source code is governed by a BSD-style license that can be | 6 * Use of this source code is governed by a BSD-style license that can be |
7 * found in the LICENSE file. | 7 * found in the LICENSE file. |
8 */ | 8 */ |
9 | 9 |
10 | 10 |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 SkShader* getShader() const { return fShader; } | 507 SkShader* getShader() const { return fShader; } |
508 | 508 |
509 /** Set or clear the shader object. | 509 /** Set or clear the shader object. |
510 * Shaders specify the source color(s) for what is being drawn. If a paint | 510 * Shaders specify the source color(s) for what is being drawn. If a paint |
511 * has no shader, then the paint's color is used. If the paint has a | 511 * has no shader, then the paint's color is used. If the paint has a |
512 * shader, then the shader's color(s) are use instead, but they are | 512 * shader, then the shader's color(s) are use instead, but they are |
513 * modulated by the paint's alpha. This makes it easy to create a shader | 513 * modulated by the paint's alpha. This makes it easy to create a shader |
514 * once (e.g. bitmap tiling or gradient) and then change its transparency | 514 * once (e.g. bitmap tiling or gradient) and then change its transparency |
515 * w/o having to modify the original shader... only the paint's alpha needs | 515 * w/o having to modify the original shader... only the paint's alpha needs |
516 * to be modified. | 516 * to be modified. |
| 517 * |
| 518 * The only exception is that the shader's bitmap is kA8_Config. In that ca
se, |
| 519 * the paint's color is used, and modulated by the shader's alpha. |
| 520 * |
517 * <p /> | 521 * <p /> |
518 * Pass NULL to clear any previous shader. | 522 * Pass NULL to clear any previous shader. |
519 * As a convenience, the parameter passed is also returned. | 523 * As a convenience, the parameter passed is also returned. |
520 * If a previous shader exists, its reference count is decremented. | 524 * If a previous shader exists, its reference count is decremented. |
521 * If shader is not NULL, its reference count is incremented. | 525 * If shader is not NULL, its reference count is incremented. |
522 * @param shader May be NULL. The shader to be installed in the paint | 526 * @param shader May be NULL. The shader to be installed in the paint |
523 * @return shader | 527 * @return shader |
524 */ | 528 */ |
525 SkShader* setShader(SkShader* shader); | 529 SkShader* setShader(SkShader* shader); |
526 | 530 |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 #ifdef SK_BUILD_FOR_ANDROID | 1151 #ifdef SK_BUILD_FOR_ANDROID |
1148 SkPaintOptionsAndroid fPaintOptionsAndroid; | 1152 SkPaintOptionsAndroid fPaintOptionsAndroid; |
1149 | 1153 |
1150 // In order for the == operator to work properly this must be the last field | 1154 // In order for the == operator to work properly this must be the last field |
1151 // in the struct so that we can do a memcmp to this field's offset. | 1155 // in the struct so that we can do a memcmp to this field's offset. |
1152 uint32_t fGenerationID; | 1156 uint32_t fGenerationID; |
1153 #endif | 1157 #endif |
1154 }; | 1158 }; |
1155 | 1159 |
1156 #endif | 1160 #endif |
OLD | NEW |