remove code from SK_SUPPORT_LEGACY_NEWFROMGENERATOR, eliminates caller of deprecated SkInstallDiscardablePixelRef
BUG=skia: Review URL: https://codereview.chromium.org/1344663002
This commit is contained in:
parent
48392b7c63
commit
2bcab82787
@ -84,7 +84,6 @@ GrTexture* SkImage_Generator::asTextureRef(GrContext* ctx, SkImageUsageType usag
|
|||||||
return fCache->lockAsTexture(ctx, usage);
|
return fCache->lockAsTexture(ctx, usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SK_SUPPORT_LEGACY_NEWFROMGENERATOR
|
|
||||||
SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
|
SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
|
||||||
SkImageCacherator* cache = SkImageCacherator::NewFromGenerator(generator, subset);
|
SkImageCacherator* cache = SkImageCacherator::NewFromGenerator(generator, subset);
|
||||||
if (!cache) {
|
if (!cache) {
|
||||||
@ -92,4 +91,3 @@ SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* s
|
|||||||
}
|
}
|
||||||
return SkNEW_ARGS(SkImage_Generator, (cache));
|
return SkNEW_ARGS(SkImage_Generator, (cache));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@ -280,16 +280,3 @@ bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) c
|
|||||||
}
|
}
|
||||||
return this->INHERITED::onAsLegacyBitmap(bitmap, mode);
|
return this->INHERITED::onAsLegacyBitmap(bitmap, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SK_SUPPORT_LEGACY_NEWFROMGENERATOR
|
|
||||||
SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
|
|
||||||
SkBitmap bitmap;
|
|
||||||
if (!SkInstallDiscardablePixelRef(generator, subset, &bitmap, nullptr)) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
if (0 == bitmap.width() || 0 == bitmap.height()) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
return new SkImage_Raster(bitmap, nullptr);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
Loading…
Reference in New Issue
Block a user