Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Side by Side Diff: include/core/SkShader.h

Issue 1778393002: add Make variations to return SkImage by sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: roll in fmalitas comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef SkShader_DEFINED 8 #ifndef SkShader_DEFINED
9 #define SkShader_DEFINED 9 #define SkShader_DEFINED
10 10
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 * successfully creating a picture shader. 397 * successfully creating a picture shader.
398 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection. 398 * @param tmx The tiling mode to use when sampling the bitmap in the x-dir ection.
399 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection. 399 * @param tmy The tiling mode to use when sampling the bitmap in the y-dir ection.
400 * @param tile The tile rectangle in picture coordinates: this represents t he subset 400 * @param tile The tile rectangle in picture coordinates: this represents t he subset
401 * (or superset) of the picture used when building a tile. It i s not 401 * (or superset) of the picture used when building a tile. It i s not
402 * affected by localMatrix and does not imply scaling (only tra nslation 402 * affected by localMatrix and does not imply scaling (only tra nslation
403 * and cropping). If null, the tile rect is considered equal to the picture 403 * and cropping). If null, the tile rect is considered equal to the picture
404 * bounds. 404 * bounds.
405 * @return Returns a new shader object. Note: this function never retur ns null. 405 * @return Returns a new shader object. Note: this function never retur ns null.
406 */ 406 */
407 static sk_sp<SkShader> MakePictureShader(sk_sp<const SkPicture> src, TileMod e tmx, TileMode tmy, 407 static sk_sp<SkShader> MakePictureShader(sk_sp<SkPicture> src, TileMode tmx, TileMode tmy,
408 const SkMatrix* localMatrix, const SkRect* tile); 408 const SkMatrix* localMatrix, const SkRect* tile);
409 409
410 /** 410 /**
411 * If this shader can be represented by another shader + a localMatrix, ret urn that shader 411 * If this shader can be represented by another shader + a localMatrix, ret urn that shader
412 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo calMatrix parameter. 412 * and, if not NULL, the localMatrix. If not, return NULL and ignore the lo calMatrix parameter.
413 * 413 *
414 * Note: the returned shader (if not NULL) will have been ref'd, and it is the responsibility 414 * Note: the returned shader (if not NULL) will have been ref'd, and it is the responsibility
415 * of the caller to balance that with unref() when they are done. 415 * of the caller to balance that with unref() when they are done.
416 */ 416 */
417 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const; 417 virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 SkMatrix fLocalMatrix; 450 SkMatrix fLocalMatrix;
451 451
452 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor. 452 // So the SkLocalMatrixShader can whack fLocalMatrix in its SkReadBuffer con structor.
453 friend class SkLocalMatrixShader; 453 friend class SkLocalMatrixShader;
454 friend class SkBitmapProcShader; // for computeTotalInverse() 454 friend class SkBitmapProcShader; // for computeTotalInverse()
455 455
456 typedef SkFlattenable INHERITED; 456 typedef SkFlattenable INHERITED;
457 }; 457 };
458 458
459 #endif 459 #endif
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/c/sk_surface.cpp » ('j') | src/image/SkImage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698