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 358 matching lines...) Loading... | |
369 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection. | 369 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection. |
370 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection. | 370 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection. |
371 * @return Returns a new shader object. Note: this function never retur ns null. | 371 * @return Returns a new shader object. Note: this function never retur ns null. |
372 */ | 372 */ |
373 static SkShader* CreateBitmapShader(const SkBitmap& src, | 373 static SkShader* CreateBitmapShader(const SkBitmap& src, |
374 TileMode tmx, TileMode tmy); | 374 TileMode tmx, TileMode tmy); |
375 | 375 |
376 /** Call this to create a new shader that will draw with the specified pictu re. | 376 /** Call this to create a new shader that will draw with the specified pictu re. |
377 * | 377 * |
378 * @param src The picture to use inside the shader (if not NULL, its ref c ount | 378 * @param src The picture to use inside the shader (if not NULL, its ref c ount |
379 * is incremented). | 379 * is incremented). The SkPicture must not be changed after |
380 * successfully creating a picture shader. | |
381 * FIXME: It may make more sense to take ownership than to add a | |
scroggo
2014/04/15 19:15:49
From a code search of Chromium, it looks like they
robertphillips
2014/04/15 19:26:44
SkPictures that are functionally immutable should
f(malita)
2014/04/15 19:40:40
Chromium is not using this yet, so it would be fin
scroggo
2014/04/15 20:33:20
Sounds good. I've just left it a ref, and made a n
| |
382 * reference. Once we split SkPicture into record and playback, this | |
383 * should take a playback. | |
380 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection. | 384 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection. |
381 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection. | 385 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection. |
382 * @return Returns a new shader object. Note: this function never retur ns null. | 386 * @return Returns a new shader object. Note: this function never retur ns null. |
383 */ | 387 */ |
384 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy); | 388 static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy); |
385 | 389 |
386 SK_TO_STRING_VIRT() | 390 SK_TO_STRING_VIRT() |
387 SK_DEFINE_FLATTENABLE_TYPE(SkShader) | 391 SK_DEFINE_FLATTENABLE_TYPE(SkShader) |
388 | 392 |
389 protected: | 393 protected: |
390 | 394 |
391 SkShader(SkReadBuffer& ); | 395 SkShader(SkReadBuffer& ); |
392 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 396 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
393 | 397 |
394 private: | 398 private: |
395 SkMatrix fLocalMatrix; | 399 SkMatrix fLocalMatrix; |
396 | 400 |
397 bool computeTotalInverse(const SkMatrix& matrix, SkMatrix* totalInverse) con st; | 401 bool computeTotalInverse(const SkMatrix& matrix, SkMatrix* totalInverse) con st; |
398 | 402 |
399 typedef SkFlattenable INHERITED; | 403 typedef SkFlattenable INHERITED; |
400 }; | 404 }; |
401 | 405 |
402 #endif | 406 #endif |
OLD | NEW |