Fix floating tab overlay for Tabs widget on Skia backend

This commit is contained in:
David Capello 2015-10-14 18:38:53 -03:00
parent ae1861236e
commit a16c5b9846

View File

@ -919,13 +919,18 @@ void Tabs::createFloatingOverlay(Tab* tab)
// Fill the surface with pink color
{
she::ScopedSurfaceLock lock(surface);
#ifdef USE_ALLEG4_BACKEND
lock->fillRect(gfx::rgba(255, 0, 255), gfx::Rect(0, 0, surface->width(), surface->height()));
#else
lock->fillRect(gfx::rgba(0, 0, 0, 0), gfx::Rect(0, 0, surface->width(), surface->height()));
#endif
}
{
Graphics g(surface, 0, 0);
g.setFont(getFont());
drawTab(&g, g.getClipBounds(), tab, 0, true, true);
}
#ifdef USE_ALLEG4_BACKEND
// Make pink parts transparent (TODO remove this hack when we change the back-end to Skia)
{
she::ScopedSurfaceLock lock(surface);
@ -937,6 +942,7 @@ void Tabs::createFloatingOverlay(Tab* tab)
lock->putPixel(c, x, y);
}
}
#endif
m_floatingOverlay.reset(new Overlay(surface, gfx::Point(), Overlay::MouseZOrder-1));
OverlayManager::instance()->addOverlay(m_floatingOverlay.get());