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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 536003002: Hide fields in SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix qt Created 6 years, 3 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/gpu/GrSurface.cpp ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index d26d4f8ed28831265feaea6f9978570c68a723d5..1b6558ce433a12288fe91773a5b25c0d97049075 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -168,17 +168,19 @@ SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo
return NULL;
}
- SkImageInfo info = origInfo;
+ SkColorType ct = origInfo.colorType();
+ SkAlphaType at = origInfo.alphaType();
// TODO: perhas we can loosen this check now that colortype is more detailed
// e.g. can we support both RGBA and BGRA here?
- if (kRGB_565_SkColorType == info.colorType()) {
- info.fAlphaType = kOpaque_SkAlphaType; // force this setting
+ if (kRGB_565_SkColorType == ct) {
+ at = kOpaque_SkAlphaType; // force this setting
} else {
- info.fColorType = kN32_SkColorType;
- if (kOpaque_SkAlphaType != info.alphaType()) {
- info.fAlphaType = kPremul_SkAlphaType; // force this setting
+ ct = kN32_SkColorType;
+ if (kOpaque_SkAlphaType != at) {
+ at = kPremul_SkAlphaType; // force this setting
}
}
+ const SkImageInfo info = SkImageInfo::Make(origInfo.width(), origInfo.height(), ct, at);
GrTextureDesc desc;
desc.fFlags = kRenderTarget_GrTextureFlagBit;
« no previous file with comments | « src/gpu/GrSurface.cpp ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698