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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 985993002: linux/x11: Fix setting custom window shapes in High DPI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index c6fc3d741df0f5d11ad26d27bbfb428768bbcb81..fc4a9f4992cd6654c4ab6c585eb89c8829f550b4 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -492,8 +492,21 @@ void DesktopWindowTreeHostX11::SetShape(gfx::NativeRegion native_region) {
window_shape_ = NULL;
if (native_region) {
+ gfx::Transform transform = GetRootTransform();
+ if (!transform.IsIdentity() && !native_region->isEmpty()) {
+ SkPath path_in_dip;
+ if (native_region->getBoundaryPath(&path_in_dip)) {
+ SkPath path_in_pixels;
+ path_in_dip.transform(transform.matrix(), &path_in_pixels);
+ window_shape_ = gfx::CreateRegionFromSkPath(path_in_pixels);
+ } else {
+ window_shape_ = XCreateRegion();
+ }
+ } else {
+ window_shape_ = gfx::CreateRegionFromSkRegion(*native_region);
+ }
+
custom_window_shape_ = true;
- window_shape_ = gfx::CreateRegionFromSkRegion(*native_region);
delete native_region;
}
ResetWindowRegion();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698