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

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

Issue 2826343002: Remove use of WS_EX_COMPOSITED for translucent windows. (Closed)
Patch Set: post-review changes 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/base/win/internal_constants.h » ('j') | no next file with comments »
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..4261878c463660f6cde3044a759b3cc3a5185470 100644
--- a/content/browser/compositor/software_output_device_win.cc
+++ b/content/browser/compositor/software_output_device_win.cc
@@ -10,6 +10,7 @@
#include "content/public/browser/browser_thread.h"
#include "skia/ext/platform_canvas.h"
#include "skia/ext/skia_utils_win.h"
+#include "ui/base/win/internal_constants.h"
#include "ui/compositor/compositor.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/skia_util.h"
@@ -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_, ui::kWindowTranslucent);
// 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/base/win/internal_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698