Bug 966679 - Implement widget paint flashing for BasicCompositor. r=roc

This commit is contained in:
Matt Woodrow 2014-02-11 16:59:39 +13:00
Родитель c01429dd44
Коммит 1fa07848e6
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -617,7 +617,19 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
void
BasicCompositor::EndFrame()
{
// Pop aClipRectIn/bounds rect
mRenderTarget->mDrawTarget->PopClip();
if (gfxPlatform::GetPlatform()->WidgetUpdateFlashing()) {
float r = float(rand()) / RAND_MAX;
float g = float(rand()) / RAND_MAX;
float b = float(rand()) / RAND_MAX;
// We're still clipped to mInvalidRegion, so just fill the bounds.
mRenderTarget->mDrawTarget->FillRect(ToRect(mInvalidRegion.GetBounds()),
ColorPattern(Color(r, g, b, 0.2f)));
}
// Pop aInvalidregion
mRenderTarget->mDrawTarget->PopClip();
// Note: Most platforms require us to buffer drawing to the widget surface.