Kaydet (Commit) 83484b7b authored tarafından Caolán McNamara's avatar Caolán McNamara

gtk3: move cairo region clipping to svp

Change-Id: I4b4f09ee3fb7edbda3b6bb5af024c0966e3a2082
(cherry picked from commit edf56cb4)
üst 7357f6f8
...@@ -118,6 +118,20 @@ namespace ...@@ -118,6 +118,20 @@ namespace
} }
} }
void SvpSalGraphics::clipRegion(cairo_t* cr)
{
if (!m_aClipRegion.IsEmpty())
{
RectangleVector aRectangles;
m_aClipRegion.GetRegionRectangles(aRectangles);
for (RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter)
{
cairo_rectangle(cr, aRectIter->Left(), aRectIter->Top(), aRectIter->GetWidth(), aRectIter->GetHeight());
}
cairo_clip(cr);
}
}
#endif #endif
bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency) bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency)
......
...@@ -212,6 +212,7 @@ public: ...@@ -212,6 +212,7 @@ public:
#if ENABLE_CAIRO_CANVAS #if ENABLE_CAIRO_CANVAS
static cairo_t* createCairoContext(const basebmp::BitmapDeviceSharedPtr& rBuffer); static cairo_t* createCairoContext(const basebmp::BitmapDeviceSharedPtr& rBuffer);
void clipRegion(cairo_t* cr);
#endif // ENABLE_CAIRO_CANVAS #endif // ENABLE_CAIRO_CANVAS
......
...@@ -61,8 +61,6 @@ public: ...@@ -61,8 +61,6 @@ public:
cairo_t* getCairoContext() const; cairo_t* getCairoContext() const;
void clipRegion(cairo_t* cr);
private: private:
GtkWidget *mpWindow; GtkWidget *mpWindow;
static GtkStyleContext *mpButtonStyle; static GtkStyleContext *mpButtonStyle;
......
...@@ -2104,18 +2104,4 @@ cairo_t* GtkSalGraphics::getCairoContext() const ...@@ -2104,18 +2104,4 @@ cairo_t* GtkSalGraphics::getCairoContext() const
return mpFrame->getCairoContext(); return mpFrame->getCairoContext();
} }
void GtkSalGraphics::clipRegion(cairo_t* cr)
{
if (!m_aClipRegion.IsEmpty())
{
RectangleVector aRectangles;
m_aClipRegion.GetRegionRectangles(aRectangles);
for (RectangleVector::const_iterator aRectIter(aRectangles.begin()); aRectIter != aRectangles.end(); ++aRectIter)
{
cairo_rectangle(cr, aRectIter->Left(), aRectIter->Top(), aRectIter->GetWidth(), aRectIter->GetHeight());
}
cairo_clip(cr);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment