#include "SkColorFilter.h"
#include "SkConfig8888.h"
#include "SkData.h"
-#include "SkImageInfoPriv.h"
#include "SkMaskFilter.h"
#include "SkMessageBus.h"
#include "SkMipMap.h"
SkPixmap tmpPixmap;
SkBitmap tmpBitmap;
- if (!SkImageInfoIsValid(pixmap.info())) {
- return nullptr;
- }
-
const GrCaps* caps = ctx->caps();
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(pixmap.info(), *caps);
? SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware
: SkDestinationSurfaceColorMode::kLegacy;
- if (!SkImageInfoIsValid(bitmap.info())) {
- return nullptr;
- }
-
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps());
// We don't support Gray8 directly in the GL backend, so fail-over to GrUploadBitmapToTexture.
return nullptr;
}
+ SkASSERT(sizeof(int) <= sizeof(uint32_t));
+ if (bitmap.width() < 0 || bitmap.height() < 0) {
+ return nullptr;
+ }
+
SkAutoPixmapUnlock srcUnlocker;
if (!bitmap.requestLock(&srcUnlocker)) {
return nullptr;
GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
const GrMipLevel* texels, int mipLevelCount) {
- if (!SkImageInfoIsValid(info)) {
- return nullptr;
- }
-
const GrCaps* caps = ctx->caps();
return ctx->textureProvider()->createMipMappedTexture(GrImageInfoToSurfaceDesc(info, *caps),
SkBudgeted::kYes, texels,