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

Unified Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 77ce9cb3482346a5ebc719afdad8954146ccbfc1..cdf8baf682198eb406074ef21ceb150f6dae6fa6 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);
}
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698