getDeviceCapabilities is no longer need, so remove it
BUG=skia: R=bungeman@google.com, vandebo@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/198943003 git-svn-id: http://skia.googlecode.com/svn/trunk@13797 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
44a435bc1a
commit
3da3b621c3
@ -19,6 +19,7 @@
|
||||
'SK_SUPPORT_LEGACY_GETCLIPTYPE',
|
||||
'SK_SUPPORT_LEGACY_GETTOTALCLIP',
|
||||
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
|
||||
'SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES',
|
||||
],
|
||||
},
|
||||
}
|
||||
|
@ -66,8 +66,6 @@ public:
|
||||
static SkBitmapDevice* Create(const SkImageInfo&,
|
||||
const SkDeviceProperties* = NULL);
|
||||
|
||||
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE { return 0; }
|
||||
|
||||
/** Return the width of the device (in pixels).
|
||||
*/
|
||||
virtual int width() const SK_OVERRIDE { return fBitmap.width(); }
|
||||
|
@ -16,6 +16,11 @@
|
||||
#include "SkColor.h"
|
||||
#include "SkDeviceProperties.h"
|
||||
|
||||
// getDeviceCapabilities() is not called by skia, but this flag keeps it around
|
||||
// for clients that have "override" annotations on their subclass. These overrides
|
||||
// should be deleted.
|
||||
//#define SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES
|
||||
|
||||
//#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG
|
||||
|
||||
class SkClipStack;
|
||||
@ -63,10 +68,9 @@ public:
|
||||
|
||||
SkMetaData& getMetaData();
|
||||
|
||||
enum Capabilities {
|
||||
kVector_Capability = 0x1, //!< mask indicating a vector representation
|
||||
};
|
||||
virtual uint32_t getDeviceCapabilities() = 0;
|
||||
#ifdef SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES
|
||||
virtual uint32_t getDeviceCapabilities() { return 0; }
|
||||
#endif
|
||||
|
||||
/** Return the width of the device (in pixels).
|
||||
*/
|
||||
|
@ -67,8 +67,6 @@ public:
|
||||
virtual bool endSheet();
|
||||
virtual bool endPortfolio();
|
||||
|
||||
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
|
||||
|
||||
protected:
|
||||
virtual void clear(SkColor color) SK_OVERRIDE;
|
||||
|
||||
|
@ -74,9 +74,6 @@ public:
|
||||
virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
|
||||
|
||||
// overrides from SkBaseDevice
|
||||
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE {
|
||||
return 0;
|
||||
}
|
||||
virtual int width() const SK_OVERRIDE {
|
||||
return NULL == fRenderTarget ? 0 : fRenderTarget->width();
|
||||
}
|
||||
|
@ -70,8 +70,6 @@ public:
|
||||
const SkMatrix& initialTransform);
|
||||
SK_API virtual ~SkPDFDevice();
|
||||
|
||||
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
|
||||
|
||||
virtual void clear(SkColor color) SK_OVERRIDE;
|
||||
|
||||
/** These are called inside the per-device-layer loop for each draw call.
|
||||
|
@ -1160,10 +1160,6 @@ HRESULT SkXPSDevice::createXpsQuad(const SkPoint (&points)[4],
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
uint32_t SkXPSDevice::getDeviceCapabilities() {
|
||||
return kVector_Capability;
|
||||
}
|
||||
|
||||
void SkXPSDevice::clear(SkColor color) {
|
||||
//TODO: override this for XPS
|
||||
SkDEBUGF(("XPS clear not yet implemented."));
|
||||
|
@ -807,10 +807,6 @@ void SkPDFDevice::cleanUp(bool clearFontUsage) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t SkPDFDevice::getDeviceCapabilities() {
|
||||
return kVector_Capability;
|
||||
}
|
||||
|
||||
void SkPDFDevice::clear(SkColor color) {
|
||||
this->cleanUp(true);
|
||||
this->init();
|
||||
@ -1341,13 +1337,7 @@ void SkPDFDevice::drawVertices(const SkDraw& d, SkCanvas::VertexMode,
|
||||
|
||||
void SkPDFDevice::drawDevice(const SkDraw& d, SkBaseDevice* device,
|
||||
int x, int y, const SkPaint& paint) {
|
||||
if ((device->getDeviceCapabilities() & kVector_Capability) == 0) {
|
||||
// If we somehow get a raster device, do what our parent would do.
|
||||
INHERITED::drawDevice(d, device, x, y, paint);
|
||||
return;
|
||||
}
|
||||
|
||||
// Assume that a vector capable device means that it's a PDF Device.
|
||||
// our onCreateDevice() always creates SkPDFDevice subclasses.
|
||||
SkPDFDevice* pdfDevice = static_cast<SkPDFDevice*>(device);
|
||||
if (pdfDevice->isContentEmpty()) {
|
||||
return;
|
||||
|
@ -157,7 +157,6 @@ public:
|
||||
void setMaxRecordingStorage(size_t);
|
||||
void recordedDrawCommand();
|
||||
|
||||
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE;
|
||||
virtual int width() const SK_OVERRIDE;
|
||||
virtual int height() const SK_OVERRIDE;
|
||||
virtual SkBitmap::Config config() const SK_OVERRIDE;
|
||||
@ -432,10 +431,6 @@ SkImage* SkDeferredDevice::newImageSnapshot() {
|
||||
return fSurface ? fSurface->newImageSnapshot() : NULL;
|
||||
}
|
||||
|
||||
uint32_t SkDeferredDevice::getDeviceCapabilities() {
|
||||
return immediateDevice()->getDeviceCapabilities();
|
||||
}
|
||||
|
||||
int SkDeferredDevice::width() const {
|
||||
return immediateDevice()->width();
|
||||
}
|
||||
|
@ -37,8 +37,6 @@ public:
|
||||
SkSafeUnref(fPRCont);
|
||||
}
|
||||
|
||||
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE { return 0; }
|
||||
|
||||
virtual int width() const SK_OVERRIDE { return fSize.width(); }
|
||||
virtual int height() const SK_OVERRIDE { return fSize.height(); }
|
||||
virtual bool isOpaque() const SK_OVERRIDE { return false; }
|
||||
|
@ -58,7 +58,6 @@ public:
|
||||
fPRSet = prset;
|
||||
}
|
||||
|
||||
virtual uint32_t getDeviceCapabilities() SK_OVERRIDE { return 0; }
|
||||
virtual int width() const SK_OVERRIDE { return fSize.width(); }
|
||||
virtual int height() const SK_OVERRIDE { return fSize.height(); }
|
||||
virtual bool isOpaque() const SK_OVERRIDE { return false; }
|
||||
|
Loading…
Reference in New Issue
Block a user