Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1799)

Unified Diff: content/browser/compositor/software_output_device_win.cc

Issue 2826343002: Remove use of WS_EX_COMPOSITED for translucent windows. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | ui/gfx/win/constants.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/software_output_device_win.cc
diff --git a/content/browser/compositor/software_output_device_win.cc b/content/browser/compositor/software_output_device_win.cc
index 4cb2d876d847a429a32d02b71699b06780237303..274717603d55f69e9362b41b97c1326b955d4d17 100644
--- a/content/browser/compositor/software_output_device_win.cc
+++ b/content/browser/compositor/software_output_device_win.cc
@@ -13,6 +13,7 @@
#include "ui/compositor/compositor.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/skia_util.h"
+#include "ui/gfx/win/constants.h"
namespace content {
@@ -93,8 +94,7 @@ SoftwareOutputDeviceWin::SoftwareOutputDeviceWin(OutputDeviceBacking* backing,
in_paint_(false) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- LONG style = GetWindowLong(hwnd_, GWL_EXSTYLE);
- is_hwnd_composited_ = !!(style & WS_EX_COMPOSITED);
+ is_hwnd_composited_ = !!::GetProp(hwnd_, gfx::kChromeWindowTranslucent);
// Layered windows must be completely updated every time, so they can't
// share contents with other windows.
if (is_hwnd_composited_)
@@ -177,7 +177,7 @@ void SoftwareOutputDeviceWin::EndPaint() {
BLENDFUNCTION blend = {AC_SRC_OVER, 0x00, 0xFF, AC_SRC_ALPHA};
DWORD style = GetWindowLong(hwnd_, GWL_EXSTYLE);
- style &= ~WS_EX_COMPOSITED;
+ DCHECK(!(style & WS_EX_COMPOSITED));
style |= WS_EX_LAYERED;
SetWindowLong(hwnd_, GWL_EXSTYLE, style);
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | ui/gfx/win/constants.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698