Commit cb5adf20 authored by kylechar's avatar kylechar Committed by Commit Bot

Call XFlush() for X11 software compositing.

With OOP-D and SoftwareOutputDeviceX11 being moved to the GPU process
sometimes tooltips aren't showing up immediately. Instead an empty
tooltip window appears until something else happens that causes GPU
process to flush it's output buffer. Add call to XFlush() to prevent
this.

Bug: 892110
Change-Id: I2aba6b9e41286ff6de9a68864d412b45cdcc7345
Reviewed-on: https://chromium-review.googlesource.com/c/1335999Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608554}
parent d6b67cf8
...@@ -100,17 +100,22 @@ void SoftwareOutputDeviceX11::EndPaint() { ...@@ -100,17 +100,22 @@ void SoftwareOutputDeviceX11::EndPaint() {
XRenderFreePicture(display_, picture); XRenderFreePicture(display_, picture);
XRenderFreePicture(display_, dest_picture); XRenderFreePicture(display_, dest_picture);
XFreePixmap(display_, pixmap); XFreePixmap(display_, pixmap);
return; } else {
// TODO(jbauman): Switch to XShmPutImage since it's async.
SkPixmap pixmap;
surface_->peekPixels(&pixmap);
gfx::PutARGBImage(display_, attributes_.visual, attributes_.depth, widget_,
gc_, static_cast<const uint8_t*>(pixmap.addr()),
viewport_pixel_size_.width(),
viewport_pixel_size_.height(), rect.x(), rect.y(),
rect.x(), rect.y(), rect.width(), rect.height());
} }
// TODO(jbauman): Switch to XShmPutImage since it's async. // Ensure the new window content appears immediately. On a TYPE_UI thread we
SkPixmap pixmap; // can rely on the message loop to flush for us so XFlush() isn't necessary.
surface_->peekPixels(&pixmap); // However, this code can run on a different thread and would have to wait for
gfx::PutARGBImage(display_, attributes_.visual, attributes_.depth, widget_, // the TYPE_UI thread to no longer be idle before a flush happens.
gc_, static_cast<const uint8_t*>(pixmap.addr()), XFlush(display_);
viewport_pixel_size_.width(), viewport_pixel_size_.height(),
rect.x(), rect.y(), rect.x(), rect.y(), rect.width(),
rect.height());
} }
} // namespace viz } // namespace viz
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment