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

Unified Diff: src/core/SkSpecialImage.cpp

Issue 2246193002: Remove isOpaque from SkSpecialImage, just use alpha type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make alphaType pure virtual Created 4 years, 4 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/core/SkSpecialImage.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkSpecialImage.cpp
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index c10e88e0ca99f6203eb66d6f711039302839f1a9..240d46921947e450a8f6592ac75c060e6fffb340 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -105,12 +105,10 @@ sk_sp<SkSpecialImage> SkSpecialImage::makeTextureImage(GrContext* context) {
return nullptr;
}
- SkAlphaType at = this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
-
return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(resultTex->width(), resultTex->height()),
this->uniqueID(),
resultTex, sk_ref_sp(this->getColorSpace()), &this->props(),
- at);
+ this->alphaType());
#else
return nullptr;
#endif
@@ -220,7 +218,7 @@ public:
SkASSERT(fBitmap.getPixels());
}
- bool isOpaque() const override { return fBitmap.isOpaque(); }
+ SkAlphaType alphaType() const override { return fBitmap.alphaType(); }
size_t getSize() const override { return fBitmap.getSize(); }
@@ -334,9 +332,7 @@ public:
}
}
- bool isOpaque() const override {
- return GrPixelConfigIsOpaque(fTexture->config()) || fAlphaType == kOpaque_SkAlphaType;
- }
+ SkAlphaType alphaType() const override { return fAlphaType; }
size_t getSize() const override { return fTexture->gpuMemorySize(); }
@@ -365,9 +361,7 @@ public:
}
SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(),
- this->isOpaque() ? kOpaque_SkAlphaType
- : kPremul_SkAlphaType,
- fColorSpace);
+ this->alphaType(), fColorSpace);
if (!dst->tryAllocPixels(info)) {
return false;
« no previous file with comments | « src/core/SkSpecialImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698