diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 0bf22cd52af2..4547f9b681e6 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -1188,6 +1188,8 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae) AndroidBridge::Bridge()->GetSoftwareLayerClient(); client.BeginDrawing(gAndroidBounds.width, gAndroidBounds.height); + nsIntRect dirtyRect = ae->Rect().Intersect(nsIntRect(0, 0, gAndroidBounds.width, gAndroidBounds.height)); + nsAutoString metadata; unsigned char *bits = NULL; if (sHasDirectTexture) { @@ -1196,7 +1198,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae) sDirectTexture->Reallocate(gAndroidBounds.width, gAndroidBounds.height); } - sDirectTexture->Lock(AndroidGraphicBuffer::UsageSoftwareWrite, ae->Rect(), &bits); + sDirectTexture->Lock(AndroidGraphicBuffer::UsageSoftwareWrite, dirtyRect, &bits); } else { bits = client.LockBufferBits(); } @@ -1229,7 +1231,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae) break; } else { targetSurface->SetDeviceOffset(gfxPoint(-x, -y)); - DrawTo(targetSurface, ae->Rect()); + DrawTo(targetSurface, dirtyRect); } } } @@ -1246,7 +1248,7 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae) client.UnlockBuffer(); } - client.EndDrawing(ae->Rect(), metadata); + client.EndDrawing(dirtyRect, metadata); return; #endif