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_ColorType) {
30 if ((unsigned)info.fAlphaType > (unsigned)kLastEnum_AlphaType) {
35 if (SkImageInfoToBitmapConfig(info, &isOpaque) == SkBitmap::kNo_Config) {
41 if (rowBytes < SkImageMinRowBytes(info)) {
45 int64_t size = (int64_t)info.fHeight * rowBytes;
54 SkImage_Raster(const SkImage::Info&, SkData*, size_t rb);
62 SkImage_Raster(const SkImage::Info&, SkPixelRef*, size_t rowBytes);
86 SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes)
87 : INHERITED(info.fWidth, info.fHeight) {
89 SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
91 fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes);
97 SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes)
98 : INHERITED(info.fWidth, info.fHeight) {
100 SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
102 fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes);
124 SkImage* SkImage::NewRasterCopy(const SkImage::Info& info, const void* pixels, size_t rowBytes) {
125 if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
128 if (0 == info.fWidth && 0 == info.fHeight) {
137 SkAutoDataUnref data(SkData::NewWithCopy(pixels, info.fHeight * rowBytes));
138 return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
142 SkImage* SkImage::NewRasterData(const SkImage::Info& info, SkData* pixelData, size_t rowBytes) {
143 if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
146 if (0 == info.fWidth && 0 == info.fHeight) {
155 size_t size = info.fHeight * rowBytes;
161 return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
164 SkImage* SkNewImageFromPixelRef(const SkImage::Info& info, SkPixelRef* pr,
166 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes));