diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 18:53:42 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 18:53:42 +0000 |
commit | 9ebcac54635cde63110d73ad7c43d70772e7872f (patch) | |
tree | 59ed546835d806d958e25892d79097724efbf983 /src/effects | |
parent | bde4ba2ce6994a57f1b4e820ac83e9d27caf75de (diff) |
add installPixels
BUG=skia:
R=halcanary@google.com
Review URL: https://codereview.chromium.org/143073008
git-svn-id: http://skia.googlecode.com/svn/trunk@13174 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkAlphaThresholdFilter.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkBicubicImageFilter.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkBlurImageFilter.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkLightingImageFilter.cpp | 3 | ||||
-rw-r--r-- | src/effects/SkPerlinNoiseShader.cpp | 6 | ||||
-rw-r--r-- | src/effects/SkTableColorFilter.cpp | 3 |
7 files changed, 8 insertions, 16 deletions
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index f15a13dd8b..4bcb32031b 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -323,8 +323,7 @@ bool SkAlphaThresholdFilterImpl::onFilterImage(Proxy*, const SkBitmap& src, } dst->setConfig(src.config(), src.width(), src.height()); - dst->allocPixels(); - if (!dst->getPixels()) { + if (!dst->allocPixels()) { return false; } diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp index 96d46aa7ce..8b89a343d0 100644 --- a/src/effects/SkBicubicImageFilter.cpp +++ b/src/effects/SkBicubicImageFilter.cpp @@ -108,8 +108,7 @@ bool SkBicubicImageFilter::onFilterImage(Proxy* proxy, return false; } result->setConfig(src.config(), dstIRect.width(), dstIRect.height()); - result->allocPixels(); - if (!result->getPixels()) { + if (!result->allocPixels()) { return false; } diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 7f3f532079..3e60c9bb87 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -160,8 +160,7 @@ bool SkBlurImageFilter::onFilterImage(Proxy* proxy, dst->setConfig(src.config(), srcBounds.width(), srcBounds.height()); dst->getBounds(&dstBounds); - dst->allocPixels(); - if (!dst->getPixels()) { + if (!dst->allocPixels()) { return false; } diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index 8264ec8e06..6ad46badb9 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -229,8 +229,7 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy, } dst->setConfig(color.config(), bounds.width(), bounds.height()); - dst->allocPixels(); - if (!dst->getPixels()) { + if (!dst->allocPixels()) { return false; } diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index b24a91eb44..81c62fe6dc 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -952,8 +952,7 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy, } dst->setConfig(src.config(), bounds.width(), bounds.height()); - dst->allocPixels(); - if (!dst->getPixels()) { + if (!dst->allocPixels()) { return false; } diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 77ce9cb348..cdf8baf682 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -241,8 +241,7 @@ public: { if (!fPermutationsBitmap) { fPermutationsBitmap = SkNEW(SkBitmap); - fPermutationsBitmap->setConfig(SkBitmap::kA8_Config, kBlockSize, 1); - fPermutationsBitmap->allocPixels(); + fPermutationsBitmap->allocPixels(SkImageInfo::MakeA8(kBlockSize, 1)); uint8_t* bitmapPixels = fPermutationsBitmap->getAddr8(0, 0); memcpy(bitmapPixels, fLatticeSelector, sizeof(uint8_t) * kBlockSize); } @@ -253,8 +252,7 @@ public: { if (!fNoiseBitmap) { fNoiseBitmap = SkNEW(SkBitmap); - fNoiseBitmap->setConfig(SkBitmap::kARGB_8888_Config, kBlockSize, 4); - fNoiseBitmap->allocPixels(); + fNoiseBitmap->allocPixels(SkImageInfo::MakeN32Premul(kBlockSize, 4)); uint32_t* bitmapPixels = fNoiseBitmap->getAddr32(0, 0); memcpy(bitmapPixels, fNoise[0][0], sizeof(uint16_t) * kBlockSize * 4 * 2); } diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index 203f058364..2872ed14b0 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -203,8 +203,7 @@ bool SkTable_ColorFilter::asComponentTable(SkBitmap* table) const { if (table) { if (NULL == fBitmap) { SkBitmap* bmp = SkNEW(SkBitmap); - bmp->setConfig(SkBitmap::kA8_Config, 256, 4, 256); - bmp->allocPixels(); + bmp->allocPixels(SkImageInfo::MakeA8(256, 4)); uint8_t* bitmapPixels = bmp->getAddr8(0, 0); int offset = 0; static const unsigned kFlags[] = { kA_Flag, kR_Flag, kG_Flag, kB_Flag }; |