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 rect in picture coordinates. If null, the tile rect is | |
432 * considered equal to the picture bounds. | |
431 * @return Returns a new shader object. Note: this function never retur ns null. | 433 * @return Returns a new shader object. Note: this function never retur ns null. |
432 */ | 434 */ |
433 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy, | 435 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy, |
434 const SkMatrix* localMatrix = NULL); | 436 const SkMatrix* localMatrix = NULL, |
437 const SkRect* tile = NULL); | |
reed1
2014/08/05 15:51:25
Some documentation questions:
Does adding a tile
f(malita)
2014/08/05 16:39:57
Yes, the tile offset is in "picture-space" (not af
| |
435 | 438 |
436 /** | 439 /** |
437 * Return a shader that will apply the specified localMatrix to the proxy s hader. | 440 * 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. | 441 * The specified matrix will be applied before any matrix associated with t he proxy. |
439 * | 442 * |
440 * Note: ownership of the proxy is not transferred (though a ref is taken). | 443 * Note: ownership of the proxy is not transferred (though a ref is taken). |
441 */ | 444 */ |
442 static SkShader* CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& lo calMatrix); | 445 static SkShader* CreateLocalMatrixShader(SkShader* proxy, const SkMatrix& lo calMatrix); |
443 | 446 |
444 /** | 447 /** |
(...skipping 25 matching lines...) Expand all Loading... | |
470 // constructors. | 473 // constructors. |
471 SkMatrix fLocalMatrix; | 474 SkMatrix fLocalMatrix; |
472 | 475 |
473 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. | 476 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. |
474 friend class SkLocalMatrixShader; | 477 friend class SkLocalMatrixShader; |
475 | 478 |
476 typedef SkFlattenable INHERITED; | 479 typedef SkFlattenable INHERITED; |
477 }; | 480 }; |
478 | 481 |
479 #endif | 482 #endif |
OLD | NEW |