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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 /** Call this to create a new shader that will draw with the specified pictu
re. | 395 /** Call this to create a new shader that will draw with the specified pictu
re. |
396 * | 396 * |
397 * @param src The picture to use inside the shader (if not NULL, its ref c
ount | 397 * @param src The picture to use inside the shader (if not NULL, its ref c
ount |
398 * is incremented). The SkPicture must not be changed after | 398 * is incremented). The SkPicture must not be changed after |
399 * successfully creating a picture shader. | 399 * successfully creating a picture shader. |
400 * FIXME: src cannot be const due to SkCanvas::drawPicture | 400 * FIXME: src cannot be const due to SkCanvas::drawPicture |
401 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. | 401 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir
ection. |
402 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. | 402 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir
ection. |
403 * @return Returns a new shader object. Note: this function never retur
ns null. | 403 * @return Returns a new shader object. Note: this function never retur
ns null. |
404 */ | 404 */ |
405 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode
tmy, | 405 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode
tmy); |
406 const SkMatrix* localMatrix = NULL); | |
407 | 406 |
408 SK_TO_STRING_VIRT() | 407 SK_TO_STRING_VIRT() |
409 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 408 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
410 | 409 |
411 protected: | 410 protected: |
412 | 411 |
413 SkShader(SkReadBuffer& ); | 412 SkShader(SkReadBuffer& ); |
414 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 413 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
415 | 414 |
416 private: | 415 private: |
417 SkMatrix fLocalMatrix; | 416 SkMatrix fLocalMatrix; |
418 | 417 |
419 bool computeTotalInverse(const SkMatrix& matrix, SkMatrix* totalInverse) con
st; | 418 bool computeTotalInverse(const SkMatrix& matrix, SkMatrix* totalInverse) con
st; |
420 | 419 |
421 typedef SkFlattenable INHERITED; | 420 typedef SkFlattenable INHERITED; |
422 }; | 421 }; |
423 | 422 |
424 #endif | 423 #endif |
OLD | NEW |