aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/core/SkCanvas.h30
-rw-r--r--include/core/SkDevice.h44
-rw-r--r--include/core/SkScalerContext.h2
-rw-r--r--include/gpu/SkGpuDeviceFactory.h58
-rw-r--r--include/pdf/SkPDFDevice.h14
5 files changed, 6 insertions, 142 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index a7f01c4b3d..53c13e552e 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -52,15 +52,7 @@ class SkPicture;
*/
class SK_API SkCanvas : public SkRefCnt {
public:
- /**
- DEPRECATED: Will be replaced by SkDevice::createCompatibleDevice
-
- Construct a canvas with the given device factory.
- @param factory Specify the factory for generating additional devices.
- The factory may be null, in which case
- SkRasterDeviceFactory will be used.
- */
- explicit SkCanvas(SkDeviceFactory* factory = NULL);
+ SkCanvas();
/** Construct a canvas with the specified device to draw into. The device
factory will be retrieved from the passed device.
@@ -106,24 +98,8 @@ public:
SkDevice* setBitmapDevice(const SkBitmap& bitmap);
/**
- * DEPRECATED: Will be replaced by SkDevice::createCompatibleDevice
- *
- * Return the current device factory, or NULL. The reference count of
- * the returned factory is not changed.
- */
- SkDeviceFactory* getDeviceFactory() const { return fDeviceFactory; }
-
- /**
- * DEPRECATED: Will be replaced by SkDevice::createCompatibleDevice
- *
- * Replace any existing factory with the specified factory, unrefing the
- * previous (if any), and refing the new one (if any). For convenience,
- * the factory parameter is also returned.
- */
- SkDeviceFactory* setDeviceFactory(SkDeviceFactory*);
-
- /**
- * Shortcut for getDevice()->createCompatibleDevice(...)
+ * Shortcut for getDevice()->createCompatibleDevice(...).
+ * If getDevice() == NULL, this method does nothing, and returns NULL.
*/
SkDevice* createCompatibleDevice(SkBitmap::Config config,
int width, int height,
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index fcc28d5b9a..142748c0cd 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -30,28 +30,6 @@ class SkMatrix;
class SkMetaData;
class SkRegion;
-/** \class SkDeviceFactory
-
- DEPRECATED: Will be replaced by SkDevice::createCompatibleDevice
-
- Devices that extend SkDevice should also provide a SkDeviceFactory class
- to pass into SkCanvas. Doing so will eliminate the need to extend
- SkCanvas as well.
-*/
-class SK_API SkDeviceFactory : public SkRefCnt {
-public:
- SkDeviceFactory();
- virtual ~SkDeviceFactory();
- virtual SkDevice* newDevice(SkCanvas*, SkBitmap::Config, int width,
- int height, bool isOpaque, bool isLayer) = 0;
-};
-
-class SkRasterDeviceFactory : public SkDeviceFactory {
-public:
- virtual SkDevice* newDevice(SkCanvas*, SkBitmap::Config, int width,
- int height, bool isOpaque, bool isLayer);
-};
-
class SK_API SkDevice : public SkRefCnt {
public:
// SkDevice();
@@ -81,15 +59,6 @@ public:
virtual ~SkDevice();
/**
- * DEPRECATED: Will be replaced by SkDevice::createCompatibleDevice
- *
- * Return the factory that will create this subclass of SkDevice.
- * The returned factory is cached by the device, and so its reference count
- * is not changed by this call.
- */
- SkDeviceFactory* getDeviceFactory();
-
- /**
* Creates a device that is of the same type as this device (e.g. SW-raster,
* GPU, or PDF). The backing store for this device is created automatically
* (e.g. offscreen pixels or FBO or whatever is appropriate).
@@ -282,17 +251,6 @@ public:
virtual bool filterTextFlags(const SkPaint& paint, TextFlags*);
protected:
- /**
- * DEPRECATED: Will be replaced by SkDevice::createCompatibleDevice
- *
- * subclasses can override this to return a new (or ref'd) instance of
- * a device factory that will create this subclass of device. This value
- * is cached, so it should get called at most once for a given instance.
- *
- * If not overriden then createCompatibleDevice will be used by canvas.
- */
- virtual SkDeviceFactory* onNewDeviceFactory();
-
/** Update as needed the pixel value in the bitmap, so that the caller can access
the pixels directly. Note: only the pixels field should be altered. The config/width/height/rowbytes
must remain unchanged.
@@ -330,8 +288,6 @@ private:
SkBitmap fBitmap;
SkIPoint fOrigin;
SkMetaData* fMetaData;
-
- SkDeviceFactory* fCachedDeviceFactory;
};
#endif
diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h
index f1898ebb0d..dc8a7587a0 100644
--- a/include/core/SkScalerContext.h
+++ b/include/core/SkScalerContext.h
@@ -168,10 +168,12 @@ public:
kDevKernText_Flag = 0x02,
kGammaForBlack_Flag = 0x04, // illegal to set both Gamma flags
kGammaForWhite_Flag = 0x08, // illegal to set both Gamma flags
+
// together, these two flags resulting in a two bit value which matches
// up with the SkPaint::Hinting enum.
kHintingBit1_Flag = 0x10,
kHintingBit2_Flag = 0x20,
+
kEmbeddedBitmapText_Flag = 0x40,
kEmbolden_Flag = 0x80,
kSubpixelPositioning_Flag = 0x100,
diff --git a/include/gpu/SkGpuDeviceFactory.h b/include/gpu/SkGpuDeviceFactory.h
deleted file mode 100644
index 6f62ad6f9d..0000000000
--- a/include/gpu/SkGpuDeviceFactory.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright 2010 Google Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
-
-#ifndef SkGpuDeviceFactory_DEFINED
-#define SkGpuDeviceFactory_DEFINED
-
-#include "SkDevice.h"
-
-class GrContext;
-
-class SK_API SkGpuDeviceFactory : public SkDeviceFactory {
-public:
- /**
- * The constructor will ref() the context, passing it to each device
- * that it creates. It will be unref()'d in the destructor
- * Non-layered devices created by the factory will draw to the
- * rootRenderTarget. rootRenderTarget is ref-counted by the factory.
- * SkGpuDevice::Current3DApiRenderTarget() can be passed as a special
- * value that will cause the factory to create a render target object
- * that reflects the state of the underlying 3D API at the time of
- * construction.
- */
- SkGpuDeviceFactory(GrContext*, GrRenderTarget* rootRenderTarget);
-
- /**
- * When the root layer is both a GrRenderTarget and a GrTexture it
- * is handy to have the factory hang on to a ref to the GrTexture object.
- * This is because the GrTexture has a ref to the GrRenderTarget but not
- * vice-versa.
- */
- SkGpuDeviceFactory(GrContext*, GrTexture* rootRenderTargetTexture);
-
- virtual ~SkGpuDeviceFactory();
-
- virtual SkDevice* newDevice(SkCanvas*, SkBitmap::Config, int width,
- int height, bool isOpaque, bool isLayer);
-
-private:
- GrContext* fContext;
- GrRenderTarget* fRootRenderTarget;
- GrTexture* fRootTexture;
-};
-
-#endif
-
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index afe0ffff80..a5abcfcc50 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -39,12 +39,6 @@ class SkPDFStream;
struct ContentEntry;
struct GraphicStateEntry;
-class SkPDFDeviceFactory : public SkDeviceFactory {
-public:
- virtual SkDevice* newDevice(SkCanvas*, SkBitmap::Config, int width,
- int height, bool isOpaque, bool isForLayer);
-};
-
/** \class SkPDFDevice
The drawing context for the PDF backend.
@@ -65,7 +59,7 @@ public:
* a scale+translate transform to move the origin from the
* bottom left (PDF default) to the top left. Note2: drawDevice
* (used by layer restore) draws the device after this initial
- * transform is applied, so the PDF device factory does an
+ * transform is applied, so the PDF device does an
* inverse scale+translate to accommodate the one that SkPDFDevice
* always does.
*/
@@ -150,12 +144,7 @@ public:
return fInitialTransform;
}
-protected:
- // override
- virtual SkDeviceFactory* onNewDeviceFactory();
-
private:
- friend class SkPDFDeviceFactory;
// TODO(vandebo) push most of SkPDFDevice's state into a core object in
// order to get the right access levels without using friend.
friend class ScopedContentEntry;
@@ -175,7 +164,6 @@ private:
SkTScopedPtr<ContentEntry> fContentEntries;
ContentEntry* fLastContentEntry;
- // For use by the DeviceFactory.
SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack,
const SkRegion& existingClipRegion);