Commit 6435a49c authored by kylechar's avatar kylechar Committed by Commit Bot

Add parameter to force |is_hwnd_composited_| false.

Add an parameter to SoftwareOutputDeviceWin to always set
|is_hwnd_composited_| to false. This parameter is only set true when
running OOP-D (eg. VizDisplayCompositor feature) so it should have no
effect on normal canary users.

The reason for this CL is that the calls to SetWindowLong() and
UpdateLayeredWindow() don't work in the GPU process. The other drawing
path works correctly. Certain top level windows, for example the omnibox
popup or the URL tooltip, use this path and don't show up with OOP-D.

Not using the layered window drawing path works properly on Windows 10.
I'm not totally sure how it will effect Windows 7 and Vista, hence this
patch to make it possible to test with canary. This should be reverted
after testing.

Bug: 826633
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: If632d25c7111161e2a84caae8dc7b13d65f9ff51
Reviewed-on: https://chromium-review.googlesource.com/1022123Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552464}
parent 77e48459
...@@ -182,8 +182,9 @@ GpuDisplayProvider::CreateSoftwareOutputDeviceForPlatform( ...@@ -182,8 +182,9 @@ GpuDisplayProvider::CreateSoftwareOutputDeviceForPlatform(
#if defined(OS_WIN) #if defined(OS_WIN)
if (!output_device_backing_) if (!output_device_backing_)
output_device_backing_ = std::make_unique<OutputDeviceBacking>(); output_device_backing_ = std::make_unique<OutputDeviceBacking>();
return std::make_unique<SoftwareOutputDeviceWin>(output_device_backing_.get(), return std::make_unique<SoftwareOutputDeviceWin>(
widget); output_device_backing_.get(), widget,
/*force_disable_hwnd_composited=*/true);
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
// TODO(crbug.com/730660): What do we do to get something we can draw to? Can // TODO(crbug.com/730660): What do we do to get something we can draw to? Can
// we use an IO surface? Can we use CA layers and overlays like we do for gpu // we use an IO surface? Can we use CA layers and overlays like we do for gpu
......
...@@ -83,13 +83,16 @@ size_t OutputDeviceBacking::GetMaxByteSize() { ...@@ -83,13 +83,16 @@ size_t OutputDeviceBacking::GetMaxByteSize() {
return max_size; return max_size;
} }
SoftwareOutputDeviceWin::SoftwareOutputDeviceWin(OutputDeviceBacking* backing, SoftwareOutputDeviceWin::SoftwareOutputDeviceWin(
gfx::AcceleratedWidget widget) OutputDeviceBacking* backing,
gfx::AcceleratedWidget widget,
bool force_disable_hwnd_composited)
: hwnd_(widget), : hwnd_(widget),
is_hwnd_composited_(false), is_hwnd_composited_(false),
backing_(backing), backing_(backing),
in_paint_(false) { in_paint_(false) {
is_hwnd_composited_ = !!::GetProp(hwnd_, ui::kWindowTranslucent); is_hwnd_composited_ = !force_disable_hwnd_composited &&
!!::GetProp(hwnd_, ui::kWindowTranslucent);
// Layered windows must be completely updated every time, so they can't // Layered windows must be completely updated every time, so they can't
// share contents with other windows. // share contents with other windows.
if (is_hwnd_composited_) if (is_hwnd_composited_)
......
...@@ -48,8 +48,13 @@ class VIZ_SERVICE_EXPORT OutputDeviceBacking { ...@@ -48,8 +48,13 @@ class VIZ_SERVICE_EXPORT OutputDeviceBacking {
class VIZ_SERVICE_EXPORT SoftwareOutputDeviceWin : public SoftwareOutputDevice { class VIZ_SERVICE_EXPORT SoftwareOutputDeviceWin : public SoftwareOutputDevice {
public: public:
// TODO(crbug.com/826633): Investigating if the layered window drawing
// path is necessary then remove |force_disable_hwnd_composited|. This is only
// used with --enable-features=VizDisplayCompositor where
// UpdateLayeredWindow() call is blocked by GPU sandbox.
SoftwareOutputDeviceWin(OutputDeviceBacking* backing, SoftwareOutputDeviceWin(OutputDeviceBacking* backing,
gfx::AcceleratedWidget widget); gfx::AcceleratedWidget widget,
bool force_disable_hwnd_composited = false);
~SoftwareOutputDeviceWin() override; ~SoftwareOutputDeviceWin() override;
void Resize(const gfx::Size& viewport_pixel_size, void Resize(const gfx::Size& viewport_pixel_size,
......
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