| Index: src/gpu/SkGpuDevice.cpp
|
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
|
| index ee4850fa9b87f079c753aee8ed7105f9ffedf109..6f6d99140bc80881d01903702e0cb556911f9d08 100644
|
| --- a/src/gpu/SkGpuDevice.cpp
|
| +++ b/src/gpu/SkGpuDevice.cpp
|
| @@ -250,70 +250,6 @@ SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo
|
| return SkNEW_ARGS(SkGpuDevice, (context, texture.get()));
|
| }
|
|
|
| -#ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
|
| -static SkBitmap make_bitmap(SkBitmap::Config config, int width, int height) {
|
| - SkBitmap bm;
|
| - bm.setConfig(SkImageInfo::Make(width, height,
|
| - SkBitmapConfigToColorType(config),
|
| - kPremul_SkAlphaType));
|
| - return bm;
|
| -}
|
| -SkGpuDevice::SkGpuDevice(GrContext* context,
|
| - SkBitmap::Config config,
|
| - int width,
|
| - int height,
|
| - int sampleCount)
|
| - : SkBitmapDevice(make_bitmap(config, width, height))
|
| -{
|
| - fDrawProcs = NULL;
|
| -
|
| - fContext = context;
|
| - fContext->ref();
|
| -
|
| - fMainTextContext = SkNEW_ARGS(GrDistanceFieldTextContext, (fContext, fLeakyProperties));
|
| - fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, fLeakyProperties));
|
| -
|
| - fRenderTarget = NULL;
|
| - fNeedClear = false;
|
| -
|
| - if (config != SkBitmap::kRGB_565_Config) {
|
| - config = SkBitmap::kARGB_8888_Config;
|
| - }
|
| -
|
| - GrTextureDesc desc;
|
| - desc.fFlags = kRenderTarget_GrTextureFlagBit;
|
| - desc.fWidth = width;
|
| - desc.fHeight = height;
|
| - desc.fConfig = SkBitmapConfig2GrPixelConfig(config);
|
| - desc.fSampleCnt = sampleCount;
|
| -
|
| - SkImageInfo info;
|
| - if (!GrPixelConfig2ColorType(desc.fConfig, &info.fColorType)) {
|
| - sk_throw();
|
| - }
|
| - info.fWidth = width;
|
| - info.fHeight = height;
|
| - info.fAlphaType = kPremul_SkAlphaType;
|
| -
|
| - SkAutoTUnref<GrTexture> texture(fContext->createUncachedTexture(desc, NULL, 0));
|
| -
|
| - if (NULL != texture) {
|
| - fRenderTarget = texture->asRenderTarget();
|
| - fRenderTarget->ref();
|
| -
|
| - SkASSERT(NULL != fRenderTarget);
|
| -
|
| - // wrap the bitmap with a pixelref to expose our texture
|
| - SkGrPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (info, texture));
|
| - this->setPixelRef(pr)->unref();
|
| - } else {
|
| - GrPrintf("--- failed to create gpu-offscreen [%d %d]\n",
|
| - width, height);
|
| - SkASSERT(false);
|
| - }
|
| -}
|
| -#endif
|
| -
|
| SkGpuDevice::~SkGpuDevice() {
|
| if (fDrawProcs) {
|
| delete fDrawProcs;
|
|
|