Add static_assert() to check that Pixman constants match gfx::Region::Overlap

This commit is contained in:
David Capello 2014-11-07 10:29:17 -03:00
parent 9d2fd2498b
commit 24e0939ad2

View File

@ -154,6 +154,11 @@ bool Region::contains(const PointT<int>& pt) const
Region::Overlap Region::contains(const Rect& rect) const
{
static_assert(
Out == PIXMAN_REGION_OUT &&
In == PIXMAN_REGION_IN &&
Part == PIXMAN_REGION_PART, "Pixman constants have changed");
pixman_box32 box = { rect.x, rect.y, rect.x2(), rect.y2() };
return (Region::Overlap)pixman_region32_contains_rectangle(&m_region, &box);
}