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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. | 342 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. |
343 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. | 343 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. |
344 * @return Returns a new shader object. Note: this function never retur
ns null. | 344 * @return Returns a new shader object. Note: this function never retur
ns null. |
345 */ | 345 */ |
346 static SkShader* CreateBitmapShader(const SkBitmap& src, | 346 static SkShader* CreateBitmapShader(const SkBitmap& src, |
347 TileMode tmx, TileMode tmy); | 347 TileMode tmx, TileMode tmy); |
348 | 348 |
349 /** Call this to create a new shader that will draw with the specified pictu
re. | 349 /** Call this to create a new shader that will draw with the specified pictu
re. |
350 * | 350 * |
351 * @param src The picture to use inside the shader (if not NULL, its ref c
ount | 351 * @param src The picture to use inside the shader (if not NULL, its ref c
ount |
352 * is incremented). | 352 * is incremented). The SkPicture must not be changed after |
| 353 * successfully creating a picture shader. |
| 354 * FIXME: src cannot be const due to SkCanvas::drawPicture |
353 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. | 355 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. |
354 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. | 356 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. |
355 * @return Returns a new shader object. Note: this function never retur
ns null. | 357 * @return Returns a new shader object. Note: this function never retur
ns null. |
356 */ | 358 */ |
357 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode
tmy); | 359 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode
tmy); |
358 | 360 |
359 SK_TO_STRING_VIRT() | 361 SK_TO_STRING_VIRT() |
360 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 362 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
361 | 363 |
362 protected: | 364 protected: |
(...skipping 15 matching lines...) Expand all Loading... |
378 SkMatrix fLocalMatrix; | 380 SkMatrix fLocalMatrix; |
379 SkMatrix fTotalInverse; | 381 SkMatrix fTotalInverse; |
380 uint8_t fPaintAlpha; | 382 uint8_t fPaintAlpha; |
381 uint8_t fTotalInverseClass; | 383 uint8_t fTotalInverseClass; |
382 SkDEBUGCODE(SkBool8 fInSetContext;) | 384 SkDEBUGCODE(SkBool8 fInSetContext;) |
383 | 385 |
384 typedef SkFlattenable INHERITED; | 386 typedef SkFlattenable INHERITED; |
385 }; | 387 }; |
386 | 388 |
387 #endif | 389 #endif |
OLD | NEW |