diff options
author | 2014-04-07 23:11:45 +0000 | |
---|---|---|
committer | 2014-04-07 23:11:45 +0000 | |
commit | 592b2d13c9fa856ae23cf6d643a39c21216e928d (patch) | |
tree | 1a608d5cfc9fe138a048ca4a391e3c3363ee1946 /src/core/SkShader.cpp | |
parent | 1ae492f19bc3e1ddbe97b5be6380c82f9e6eacb8 (diff) |
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
Diffstat (limited to 'src/core/SkShader.cpp')
-rw-r--r-- | src/core/SkShader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp index 31b208e2cc..e337b7d906 100644 --- a/src/core/SkShader.cpp +++ b/src/core/SkShader.cpp @@ -9,6 +9,8 @@ #include "SkReadBuffer.h" #include "SkMallocPixelRef.h" #include "SkPaint.h" +#include "SkPicture.h" +#include "SkPictureShader.h" #include "SkScalar.h" #include "SkShader.h" #include "SkWriteBuffer.h" @@ -179,6 +181,10 @@ SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, return ::CreateBitmapShader(src, tmx, tmy, NULL); } +SkShader* SkShader::CreatePictureShader(SkPicture* src, TileMode tmx, TileMode tmy) { + return SkPictureShader::Create(src, tmx, tmy); +} + #ifndef SK_IGNORE_TO_STRING void SkShader::toString(SkString* str) const { if (this->hasLocalMatrix()) { |