Lines Matching refs:info
17 static bool ValidArgs(const Info& info, size_t rowBytes) {
21 if (info.fWidth < 0 || info.fHeight < 0) {
24 if (info.fWidth > maxDimension || info.fHeight > maxDimension) {
27 if ((unsigned)info.fColorType > (unsigned)kLastEnum_SkColorType) {
30 if ((unsigned)info.fAlphaType > (unsigned)kLastEnum_SkAlphaType) {
34 if (SkImageInfoToBitmapConfig(info) == SkBitmap::kNo_Config) {
40 if (rowBytes < SkImageMinRowBytes(info)) {
44 int64_t size = (int64_t)info.fHeight * rowBytes;
85 SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes)
86 : INHERITED(info.fWidth, info.fHeight) {
87 fBitmap.setConfig(info, rowBytes);
88 fBitmap.setPixelRef(SkNEW_ARGS(SkDataPixelRef, (info, data)))->unref();
92 SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes)
93 : INHERITED(info.fWidth, info.fHeight) {
94 SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
96 fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes, info.fAlphaType);
117 SkImage* SkImage::NewRasterCopy(const SkImageInfo& info, const void* pixels, size_t rowBytes) {
118 if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
121 if (0 == info.fWidth && 0 == info.fHeight) {
130 SkAutoDataUnref data(SkData::NewWithCopy(pixels, info.fHeight * rowBytes));
131 return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
135 SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* pixelData, size_t rowBytes) {
136 if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
139 if (0 == info.fWidth && 0 == info.fHeight) {
148 size_t size = info.fHeight * rowBytes;
154 return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
157 SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
159 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes));