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:
reed 2015-09-14 13:54:39 -07:00 committed by Commit bot
parent 48392b7c63
commit 2bcab82787
2 changed files with 0 additions and 15 deletions

View File

@ -84,7 +84,6 @@ GrTexture* SkImage_Generator::asTextureRef(GrContext* ctx, SkImageUsageType usag
return fCache->lockAsTexture(ctx, usage);
}
#ifndef SK_SUPPORT_LEGACY_NEWFROMGENERATOR
SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* subset) {
SkImageCacherator* cache = SkImageCacherator::NewFromGenerator(generator, subset);
if (!cache) {
@ -92,4 +91,3 @@ SkImage* SkImage::NewFromGenerator(SkImageGenerator* generator, const SkIRect* s
}
return SkNEW_ARGS(SkImage_Generator, (cache));
}
#endif

View File

@ -280,16 +280,3 @@ bool SkImage_Raster::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) c
}
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