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

Unified Diff: src/image/SkImage_Raster.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/image/SkImage.cpp ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index a7e4e009e5c2fd2d9b3a1f58457e45b116fc5b6f..f1d1fcd27ff3b5438bed4763a2ed83013a1922d3 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -19,16 +19,16 @@ public:
const int maxDimension = SK_MaxS32 >> 2;
const size_t kMaxPixelByteSize = SK_MaxS32;
- if (info.fWidth < 0 || info.fHeight < 0) {
+ if (info.width() < 0 || info.height() < 0) {
return false;
}
- if (info.fWidth > maxDimension || info.fHeight > maxDimension) {
+ if (info.width() > maxDimension || info.height() > maxDimension) {
return false;
}
- if ((unsigned)info.fColorType > (unsigned)kLastEnum_SkColorType) {
+ if ((unsigned)info.colorType() > (unsigned)kLastEnum_SkColorType) {
return false;
}
- if ((unsigned)info.fAlphaType > (unsigned)kLastEnum_SkAlphaType) {
+ if ((unsigned)info.alphaType() > (unsigned)kLastEnum_SkAlphaType) {
return false;
}
@@ -42,7 +42,7 @@ public:
return false;
}
- int64_t size = (int64_t)info.fHeight * rowBytes;
+ int64_t size = (int64_t)info.height() * rowBytes;
if (size > (int64_t)kMaxPixelByteSize) {
return false;
}
@@ -102,7 +102,7 @@ static void release_data(void* addr, void* context) {
}
SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes)
- : INHERITED(info.fWidth, info.fHeight)
+ : INHERITED(info.width(), info.height())
{
data->ref();
void* addr = const_cast<void*>(data->data());
@@ -114,7 +114,7 @@ SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes)
}
SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes)
- : INHERITED(info.fWidth, info.fHeight)
+ : INHERITED(info.width(), info.height())
{
fBitmap.setInfo(info, rowBytes);
fBitmap.setPixelRef(pr);
@@ -170,7 +170,7 @@ SkImage* SkImage::NewRasterCopy(const SkImageInfo& info, const void* pixels, siz
if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
return NULL;
}
- if (0 == info.fWidth && 0 == info.fHeight) {
+ if (0 == info.width() && 0 == info.height()) {
return SkImage_Raster::NewEmpty();
}
// check this after empty-check
@@ -179,7 +179,7 @@ SkImage* SkImage::NewRasterCopy(const SkImageInfo& info, const void* pixels, siz
}
// Here we actually make a copy of the caller's pixel data
- SkAutoDataUnref data(SkData::NewWithCopy(pixels, info.fHeight * rowBytes));
+ SkAutoDataUnref data(SkData::NewWithCopy(pixels, info.height() * rowBytes));
return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
}
@@ -188,7 +188,7 @@ SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* data, size_t ro
if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
return NULL;
}
- if (0 == info.fWidth && 0 == info.fHeight) {
+ if (0 == info.width() && 0 == info.height()) {
return SkImage_Raster::NewEmpty();
}
// check this after empty-check
@@ -197,7 +197,7 @@ SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* data, size_t ro
}
// did they give us enough data?
- size_t size = info.fHeight * rowBytes;
+ size_t size = info.height() * rowBytes;
if (data->size() < size) {
return NULL;
}
« no previous file with comments | « src/image/SkImage.cpp ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698