OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 | 8 |
9 #ifndef SkShader_DEFINED | 9 #ifndef SkShader_DEFINED |
10 #define SkShader_DEFINED | 10 #define SkShader_DEFINED |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 const SkMatrix* localMatrix = NULL); | 421 const SkMatrix* localMatrix = NULL); |
422 | 422 |
423 /** Call this to create a new shader that will draw with the specified pictu
re. | 423 /** Call this to create a new shader that will draw with the specified pictu
re. |
424 * | 424 * |
425 * @param src The picture to use inside the shader (if not NULL, its ref c
ount | 425 * @param src The picture to use inside the shader (if not NULL, its ref c
ount |
426 * is incremented). The SkPicture must not be changed after | 426 * is incremented). The SkPicture must not be changed after |
427 * successfully creating a picture shader. | 427 * successfully creating a picture shader. |
428 * FIXME: src cannot be const due to SkCanvas::drawPicture | 428 * FIXME: src cannot be const due to SkCanvas::drawPicture |
429 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. | 429 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. |
430 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. | 430 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. |
| 431 * @param tile The tile rectangle in picture coordinates: this represents t
he subset |
| 432 * (or superset) of the picture used when building a tile. It i
s not |
| 433 * affected by localMatrix and does not imply scaling (only tra
nslation |
| 434 * and cropping). If null, the tile rect is considered equal to
the picture |
| 435 * bounds. |
431 * @return Returns a new shader object. Note: this function never retur
ns null. | 436 * @return Returns a new shader object. Note: this function never retur
ns null. |
432 */ | 437 */ |
433 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode
tmy, | 438 static SkShader* CreatePictureShader(SkPicture* src, |
434 const SkMatrix* localMatrix = NULL); | 439 TileMode tmx, TileMode tmy, |
| 440 const SkMatrix* localMatrix, |
| 441 const SkRect* tile); |
435 | 442 |
436 /** | 443 /** |
437 * Return a shader that will apply the specified localMatrix to the proxy s
hader. | 444 * Return a shader that will apply the specified localMatrix to the proxy s
hader. |
438 * The specified matrix will be applied before any matrix associated with t
he proxy. | 445 * The specified matrix will be applied before any matrix associated with t
he proxy. |
439 * | 446 * |
440 * Note: ownership of the proxy is not transferred (though a ref is taken). | 447 * Note: ownership of the proxy is not transferred (though a ref is taken). |
441 */ | 448 */ |
442 static SkShader* CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& lo
calMatrix); | 449 static SkShader* CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& lo
calMatrix); |
443 | 450 |
444 /** | 451 /** |
(...skipping 25 matching lines...) Expand all Loading... |
470 // constructors. | 477 // constructors. |
471 SkMatrix fLocalMatrix; | 478 SkMatrix fLocalMatrix; |
472 | 479 |
473 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. | 480 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con
structor. |
474 friend class SkLocalMatrixShader; | 481 friend class SkLocalMatrixShader; |
475 | 482 |
476 typedef SkFlattenable INHERITED; | 483 typedef SkFlattenable INHERITED; |
477 }; | 484 }; |
478 | 485 |
479 #endif | 486 #endif |
OLD | NEW |