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
parent 5fa762bf98
commit bf435a520d

View File

@ -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.