aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-07 21:33:06 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-07 21:33:06 +0000
commitfc9482933794fb46920abc67cc84923a273e3fe1 (patch)
tree0cd1b1366cf6201d76ce61bc80807d278db359c5 /src
parentc5713e484a1f23d8ce27e801b5970c707a605fb4 (diff)
remove SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
remove SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES BUG=skia: R=robertphillips@google.com, bsalomon@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/227643005 git-svn-id: http://skia.googlecode.com/svn/trunk@14083 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapDevice.cpp27
-rw-r--r--src/core/SkDevice.cpp40
-rw-r--r--src/gpu/SkGpuDevice.cpp64
3 files changed, 0 insertions, 131 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index dd43e963e6..ba529a766b 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -68,33 +68,6 @@ SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties&
SkASSERT(valid_for_bitmap_device(bitmap.info(), NULL));
}
-#ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
-void SkBitmapDevice::init(SkBitmap::Config config, int width, int height, bool isOpaque) {
- fBitmap.setConfig(config, width, height, 0, isOpaque ?
- kOpaque_SkAlphaType : kPremul_SkAlphaType);
-
- if (SkBitmap::kNo_Config != config) {
- if (!fBitmap.allocPixels()) {
- // indicate failure by zeroing our bitmap
- fBitmap.setConfig(config, 0, 0, 0, isOpaque ?
- kOpaque_SkAlphaType : kPremul_SkAlphaType);
- } else if (!isOpaque) {
- fBitmap.eraseColor(SK_ColorTRANSPARENT);
- }
- }
-}
-
-SkBitmapDevice::SkBitmapDevice(SkBitmap::Config config, int width, int height, bool isOpaque) {
- this->init(config, width, height, isOpaque);
-}
-
-SkBitmapDevice::SkBitmapDevice(SkBitmap::Config config, int width, int height, bool isOpaque,
- const SkDeviceProperties& deviceProperties)
- : SkBaseDevice(deviceProperties)
-{
- this->init(config, width, height, isOpaque);
-}
-#endif
SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
const SkDeviceProperties* props) {
SkImageInfo info = origInfo;
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index be295cec33..255ad02e08 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -33,53 +33,13 @@ SkBaseDevice::~SkBaseDevice() {
}
SkBaseDevice* SkBaseDevice::createCompatibleDevice(const SkImageInfo& info) {
-#ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
- // We call the old method to support older subclasses.
- // If they have, we return their device, else we use the new impl.
- SkBitmap::Config config = SkColorTypeToBitmapConfig(info.colorType());
- SkBaseDevice* dev = this->onCreateCompatibleDevice(config,
- info.width(),
- info.height(),
- info.isOpaque(),
- kGeneral_Usage);
- if (dev) {
- return dev;
- }
- // fall through to new impl
-#endif
return this->onCreateDevice(info, kGeneral_Usage);
}
SkBaseDevice* SkBaseDevice::createCompatibleDeviceForSaveLayer(const SkImageInfo& info) {
-#ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
- // We call the old method to support older subclasses.
- // If they have, we return their device, else we use the new impl.
- SkBitmap::Config config = SkColorTypeToBitmapConfig(info.colorType());
- SkBaseDevice* dev = this->onCreateCompatibleDevice(config,
- info.width(),
- info.height(),
- info.isOpaque(),
- kSaveLayer_Usage);
- if (dev) {
- return dev;
- }
- // fall through to new impl
-#endif
return this->onCreateDevice(info, kSaveLayer_Usage);
}
-#ifdef SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
-SkBaseDevice* SkBaseDevice::createCompatibleDevice(SkBitmap::Config config,
- int width, int height,
- bool isOpaque) {
- SkImageInfo info = SkImageInfo::Make(width, height,
- SkBitmapConfigToColorType(config),
- isOpaque ? kOpaque_SkAlphaType
- : kPremul_SkAlphaType);
- return this->createCompatibleDevice(info);
-}
-#endif
-
SkMetaData& SkBaseDevice::getMetaData() {
// metadata users are rare, so we lazily allocate it. If that changes we
// can decide to just make it a field in the device (rather than a ptr)
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index ee4850fa9b..6f6d99140b 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;