diff --git a/gyp/skia_for_chromium_defines.gypi b/gyp/skia_for_chromium_defines.gypi index c85d706b98..d13864e3ca 100644 --- a/gyp/skia_for_chromium_defines.gypi +++ b/gyp/skia_for_chromium_defines.gypi @@ -19,6 +19,7 @@ 'SK_SUPPORT_LEGACY_GETCLIPTYPE', 'SK_SUPPORT_LEGACY_GETTOTALCLIP', 'SK_SUPPORT_LEGACY_GETTOPDEVICE', + 'SK_SUPPORT_LEGACY_GETDEVICECAPABILITIES', ], }, } diff --git a/include/core/SkBitmapDevice.h b/include/core/SkBitmapDevice.h index 5505042a04..25c35cef59 100644 --- a/include/core/SkBitmapDevice.h +++ b/include/core/SkBitmapDevice.h @@ -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(); } diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h index b3be78085f..1773d0ac18 100644 --- a/include/core/SkDevice.h +++ b/include/core/SkDevice.h @@ -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). */ diff --git a/include/device/xps/SkXPSDevice.h b/include/device/xps/SkXPSDevice.h index 37df14b9a4..7265fbbedc 100644 --- a/include/device/xps/SkXPSDevice.h +++ b/include/device/xps/SkXPSDevice.h @@ -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; diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h index 64bd33f439..94ca8d46d8 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -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(); } diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h index 0dd06469b4..daec7a3de7 100644 --- a/include/pdf/SkPDFDevice.h +++ b/include/pdf/SkPDFDevice.h @@ -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. diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp index f2901316c2..e7b5d41fb0 100644 --- a/src/device/xps/SkXPSDevice.cpp +++ b/src/device/xps/SkXPSDevice.cpp @@ -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.")); diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index ff3878b803..efd2b02b50 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -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(device); if (pdfDevice->isContentEmpty()) { return; diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 6592c60884..07bd6acda6 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -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(); } diff --git a/src/utils/SkGatherPixelRefsAndRects.h b/src/utils/SkGatherPixelRefsAndRects.h index 4b5bb6f9e5..75d096918e 100644 --- a/src/utils/SkGatherPixelRefsAndRects.h +++ b/src/utils/SkGatherPixelRefsAndRects.h @@ -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; } diff --git a/src/utils/SkPictureUtils.cpp b/src/utils/SkPictureUtils.cpp index e41bfecfb4..99914a7c7a 100644 --- a/src/utils/SkPictureUtils.cpp +++ b/src/utils/SkPictureUtils.cpp @@ -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; }