Bug 1258086 - Clear unbuffered SHM images with a 32-bit visual before drawing with the basic layer manager. r=lsalzman

MozReview-Commit-ID: 8XgVwvBDZ3X

--HG--
extra : rebase_source : ba0ed32c5b8241fa6bf6300a8fa97ad71a236c1a
This commit is contained in:
Andrew Comminos 2016-04-27 13:46:07 -07:00
Родитель a9cd8f1af3
Коммит 28d156be0f
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -2282,6 +2282,17 @@ nsWindow::OnExposeEvent(cairo_t *cr)
bool painted = false;
{
if (GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_BASIC) {
GdkScreen *screen = gdk_window_get_screen(mGdkWindow);
if (GetTransparencyMode() == eTransparencyTransparent &&
layerBuffering == BufferMode::BUFFER_NONE &&
gdk_screen_is_composited(screen) &&
gdk_window_get_visual(mGdkWindow) ==
gdk_screen_get_rgba_visual(screen)) {
// If our draw target is unbuffered and we use an alpha channel,
// clear the image beforehand to ensure we don't get artifacts from a
// reused SHM image. See bug 1258086.
dt->ClearRect(Rect(boundsRect));
}
AutoLayerManagerSetup setupLayerManager(this, ctx, layerBuffering);
painted = listener->PaintWindow(this, region);
}