diff --git a/src/vector/vpainter.cpp b/src/vector/vpainter.cpp index 1249e38590..3ff3e89b15 100644 --- a/src/vector/vpainter.cpp +++ b/src/vector/vpainter.cpp @@ -6,6 +6,7 @@ V_BEGIN_NAMESPACE class VPainterImpl { public: void drawRle(const VPoint &pos, const VRle &rle); + void drawRle(const VRle &rle, const VRle &clip); public: VRasterBuffer mBuffer; @@ -26,6 +27,17 @@ void VPainterImpl::drawRle(const VPoint &pos, const VRle &rle) &mSpanData); } +void VPainterImpl::drawRle(const VRle &rle, const VRle &clip) +{ + if (rle.empty() || clip.empty()) return; + + if (!mSpanData.mUnclippedBlendFunc) return; + + rle.intersect(clip, mSpanData.mUnclippedBlendFunc, + &mSpanData); +} + + VPainter::~VPainter() { delete mImpl; @@ -61,6 +73,12 @@ void VPainter::drawRle(const VPoint &pos, const VRle &rle) mImpl->drawRle(pos, rle); } +void VPainter::drawRle(const VRle &rle, const VRle &clip) +{ + mImpl->drawRle(rle, clip); +} + + VRect VPainter::clipBoundingRect() const { return mImpl->mSpanData.mSystemClip; diff --git a/src/vector/vpainter.h b/src/vector/vpainter.h index 67942a21f6..cb3ec4e267 100644 --- a/src/vector/vpainter.h +++ b/src/vector/vpainter.h @@ -19,6 +19,7 @@ public: void end(); void setBrush(const VBrush &brush); void drawRle(const VPoint &pos, const VRle &rle); + void drawRle(const VRle &rle, const VRle &clip); VRect clipBoundingRect() const; private: