From 592b2d13c9fa856ae23cf6d643a39c21216e928d Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Mon, 7 Apr 2014 23:11:45 +0000 Subject: Initial picture shader implementation This CL adds an SkPictureShader class to support SkPicture-based patterns. The implementation renders the picture into an SkBitmap tile and then delegates to SkBitmapProcShader for the actual operation. R=bsalomon@google.com, reed@google.com, robertphillips@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/221923007 git-svn-id: http://skia.googlecode.com/svn/trunk@14085 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/core/SkShader.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/core/SkShader.h') diff --git a/include/core/SkShader.h b/include/core/SkShader.h index acff959949..076ecf5460 100644 --- a/include/core/SkShader.h +++ b/include/core/SkShader.h @@ -16,6 +16,7 @@ #include "SkPaint.h" class SkPath; +class SkPicture; class GrContext; class GrEffectRef; @@ -345,6 +346,16 @@ public: static SkShader* CreateBitmapShader(const SkBitmap& src, TileMode tmx, TileMode tmy); + /** Call this to create a new shader that will draw with the specified picture. + * + * @param src The picture to use inside the shader (if not NULL, its ref count + * is incremented). + * @param tmx The tiling mode to use when sampling the bitmap in the x-direction. + * @param tmy The tiling mode to use when sampling the bitmap in the y-direction. + * @return Returns a new shader object. Note: this function never returns null. + */ + static SkShader* CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy); + SK_TO_STRING_VIRT() SK_DEFINE_FLATTENABLE_TYPE(SkShader) -- cgit v1.2.3