diff options
author | 2011-07-06 21:18:09 +0000 | |
---|---|---|
committer | 2011-07-06 21:18:09 +0000 | |
commit | 2be9e8b407624fa696854b78b407b97a01dbb703 (patch) | |
tree | 329ca5e8a73984307a32f232bfc3f30a0deeed03 /src/core/SkShader.cpp | |
parent | f78e78da589678dde4a1e3ba62e8ba20df3aa080 (diff) |
ColorShaders report no bitmaps, but only a color_gradient, which we now detect
on the gpu side.
git-svn-id: http://skia.googlecode.com/svn/trunk@1810 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkShader.cpp')
-rw-r--r-- | src/core/SkShader.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp index 48c9966896..6865fb7c19 100644 --- a/src/core/SkShader.cpp +++ b/src/core/SkShader.cpp @@ -219,23 +219,18 @@ SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, SkColorShader::SkColorShader() { fFlags = 0; fInheritColor = true; - fAsABitmapPixelRef = NULL; } SkColorShader::SkColorShader(SkColor c) { fFlags = 0; fColor = c; fInheritColor = false; - fAsABitmapPixelRef = NULL; } -SkColorShader::~SkColorShader() { - SkSafeUnref(fAsABitmapPixelRef); -} +SkColorShader::~SkColorShader() {} SkColorShader::SkColorShader(SkFlattenableReadBuffer& b) : INHERITED(b) { fFlags = 0; // computed in setContext - fAsABitmapPixelRef = NULL; fInheritColor = b.readU8(); if (fInheritColor) { @@ -313,25 +308,7 @@ void SkColorShader::shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) { SkShader::BitmapType SkColorShader::asABitmap(SkBitmap* bitmap, SkMatrix* matrix, TileMode modes[], SkScalar* twoPointRadialParams) const { - // we cache the pixelref, since its generateID is used in the texture cache - if (NULL == fAsABitmapPixelRef) { - SkPMColor* storage = (SkPMColor*)sk_malloc_throw(sizeof(SkPMColor)); - *storage = fPMColor; - fAsABitmapPixelRef = new SkMallocPixelRef(storage, sizeof(SkPMColor), - NULL); - } - - if (bitmap) { - bitmap->setConfig(SkBitmap::kARGB_8888_Config, 1, 1); - bitmap->setPixelRef(fAsABitmapPixelRef); - } - if (matrix) { - matrix->reset(); - } - if (modes) { - modes[0] = modes[1] = SkShader::kRepeat_TileMode; - } - return kDefault_BitmapType; + return kNone_BitmapType; } SkShader::GradientType SkColorShader::asAGradient(GradientInfo* info) const { |