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

Unified Diff: src/effects/gradients/SkGradientShader.cpp

Issue 168843002: use SkColorType instead of SkBitmap::Config in views/effects (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/SkTransparentShader.cpp ('k') | src/utils/SkCanvasStateUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkGradientShader.cpp
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 1da259afe1875dfa455ab1a0ca92814d3da601e1..5b0b9c763da184ec9b732112cbb2d76ed02ece26 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -583,7 +583,7 @@ void SkGradientShaderBase::getGradientTableBitmap(SkBitmap* bitmap) const {
if (fMapper) {
// force our cahce32pixelref to be built
(void)this->getCache32();
- bitmap->setConfig(SkBitmap::kARGB_8888_Config, kCache32Count, 1);
+ bitmap->setConfig(SkImageInfo::MakeN32Premul(kCache32Count, 1));
bitmap->setPixelRef(fCache32PixelRef);
return;
}
@@ -624,7 +624,7 @@ void SkGradientShaderBase::getGradientTableBitmap(SkBitmap* bitmap) const {
if (!gCache->find(storage.get(), size, bitmap)) {
// force our cahce32pixelref to be built
(void)this->getCache32();
- bitmap->setConfig(SkBitmap::kARGB_8888_Config, kCache32Count, 1);
+ bitmap->setConfig(SkImageInfo::MakeN32Premul(kCache32Count, 1));
bitmap->setPixelRef(fCache32PixelRef);
gCache->add(storage.get(), size, *bitmap);
@@ -1043,7 +1043,7 @@ GrGradientEffect::GrGradientEffect(GrContext* ctx,
desc.fHeight = 32;
desc.fRowHeight = bitmap.height();
desc.fContext = ctx;
- desc.fConfig = SkBitmapConfig2GrPixelConfig(bitmap.config());
+ desc.fConfig = SkImageInfo2GrPixelConfig(bitmap.colorType(), bitmap.alphaType());
fAtlas = GrTextureStripAtlas::GetAtlas(desc);
SkASSERT(NULL != fAtlas);
« no previous file with comments | « src/effects/SkTransparentShader.cpp ('k') | src/utils/SkCanvasStateUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698