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

Unified Diff: src/core/SkMallocPixelRef.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/core/SkCanvas.cpp ('k') | src/core/SkPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMallocPixelRef.cpp
diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp
index 0d50164832a0cbe306fda48c9ea1f55e41e1361c..ae29310aeaa1c98ada34da6b5c403c4cdef99cf9 100644
--- a/src/core/SkMallocPixelRef.cpp
+++ b/src/core/SkMallocPixelRef.cpp
@@ -16,10 +16,9 @@ static void sk_free_releaseproc(void* ptr, void*) {
}
static bool is_valid(const SkImageInfo& info, SkColorTable* ctable) {
- if (info.fWidth < 0 ||
- info.fHeight < 0 ||
- (unsigned)info.fColorType > (unsigned)kLastEnum_SkColorType ||
- (unsigned)info.fAlphaType > (unsigned)kLastEnum_SkAlphaType)
+ if (info.width() < 0 || info.height() < 0 ||
+ (unsigned)info.colorType() > (unsigned)kLastEnum_SkColorType ||
+ (unsigned)info.alphaType() > (unsigned)kLastEnum_SkAlphaType)
{
return false;
}
@@ -72,7 +71,7 @@ SkMallocPixelRef* SkMallocPixelRef::NewAllocate(const SkImageInfo& info,
rowBytes = minRB;
}
- int64_t bigSize = (int64_t)info.fHeight * rowBytes;
+ int64_t bigSize = (int64_t)info.height() * rowBytes;
if (!sk_64_isS32(bigSize)) {
return NULL;
}
@@ -142,7 +141,7 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage,
SkASSERT(is_valid(info, ctable));
SkASSERT(rowBytes >= info.minRowBytes());
- if (kIndex_8_SkColorType != info.fColorType) {
+ if (kIndex_8_SkColorType != info.colorType()) {
ctable = NULL;
}
@@ -165,7 +164,7 @@ SkMallocPixelRef::SkMallocPixelRef(const SkImageInfo& info, void* storage,
SkASSERT(is_valid(info, ctable));
SkASSERT(rowBytes >= info.minRowBytes());
- if (kIndex_8_SkColorType != info.fColorType) {
+ if (kIndex_8_SkColorType != info.colorType()) {
ctable = NULL;
}
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698