From kde-commits Sat Apr 30 23:14:25 2005 From: Rob Buis Date: Sat, 30 Apr 2005 23:14:25 +0000 To: kde-commits Subject: kdenonbeta/kcanvas/device Message-Id: <20050430231425.A308E665 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=111490287918363 CVS commit by buis: Also allow images as targets using special contexts. M +4 -2 KRenderingDevice.h 1.40 M +13 -1 agg/KRenderingDeviceAgg.cc 1.68 M +2 -0 agg/KRenderingDeviceAgg.h 1.36 M +1 -1 agg/KRenderingPaintServerSolidAgg.cc 1.49 --- kdenonbeta/kcanvas/device/KRenderingDevice.h #1.39:1.40 @@ -76,4 +76,6 @@ public: // Global rendering device context virtual KRenderingDeviceContext *context() const = 0; + virtual void setContext(KRenderingDeviceContext *) const = 0; + virtual KRenderingDeviceContext *makeCurrentContext(KCanvasImageBuffer *) const = 0; // Vector path creation --- kdenonbeta/kcanvas/device/agg/KRenderingDeviceAgg.cc #1.67:1.68 @@ -89,4 +89,16 @@ KRenderingDeviceContext *KRenderingDevic } +void KRenderingDeviceAgg::setContext(KRenderingDeviceContext *context) const +{ + m_context = static_cast(context); +} + +KRenderingDeviceContext *KRenderingDeviceAgg::makeCurrentContext(KCanvasImageBuffer *image) const +{ + m_context = new KRenderingDeviceContextAgg(); + m_context->setBuffer(image); + return m_context; +} + void KRenderingDeviceAgg::init(KCanvasTarget *target) { --- kdenonbeta/kcanvas/device/agg/KRenderingDeviceAgg.h #1.35:1.36 @@ -54,4 +54,6 @@ public: virtual KRenderingDeviceContext *context() const; + virtual void setContext(KRenderingDeviceContext *) const; + virtual KRenderingDeviceContext *makeCurrentContext(KCanvasImageBuffer *) const; // Vector path creation