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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 456943004: Fix SetShape (SetAlphaShape) to allow Null regions (+ tests). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing delete; Remove unnecessary layer check" Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xregion.h> 10 #include <X11/Xregion.h>
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 NOTIMPLEMENTED(); 488 NOTIMPLEMENTED();
489 return gfx::Rect(0, 0, 10, 10); 489 return gfx::Rect(0, 0, 10, 10);
490 } 490 }
491 491
492 return gfx::Rect(x, y, width, height); 492 return gfx::Rect(x, y, width, height);
493 } 493 }
494 494
495 void DesktopWindowTreeHostX11::SetShape(gfx::NativeRegion native_region) { 495 void DesktopWindowTreeHostX11::SetShape(gfx::NativeRegion native_region) {
496 if (window_shape_) 496 if (window_shape_)
497 XDestroyRegion(window_shape_); 497 XDestroyRegion(window_shape_);
498 custom_window_shape_ = true; 498 custom_window_shape_ = false;
499 window_shape_ = gfx::CreateRegionFromSkRegion(*native_region); 499 window_shape_ = NULL;
500
501 if (native_region) {
502 custom_window_shape_ = true;
503 window_shape_ = gfx::CreateRegionFromSkRegion(*native_region);
504 delete native_region;
505 }
500 ResetWindowRegion(); 506 ResetWindowRegion();
501 delete native_region;
502 } 507 }
503 508
504 void DesktopWindowTreeHostX11::Activate() { 509 void DesktopWindowTreeHostX11::Activate() {
505 if (!window_mapped_) 510 if (!window_mapped_)
506 return; 511 return;
507 512
508 X11DesktopHandler::get()->ActivateWindow(xwindow_); 513 X11DesktopHandler::get()->ActivateWindow(xwindow_);
509 } 514 }
510 515
511 void DesktopWindowTreeHostX11::Deactivate() { 516 void DesktopWindowTreeHostX11::Deactivate() {
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 if (linux_ui) { 1907 if (linux_ui) {
1903 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 1908 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
1904 if (native_theme) 1909 if (native_theme)
1905 return native_theme; 1910 return native_theme;
1906 } 1911 }
1907 1912
1908 return ui::NativeTheme::instance(); 1913 return ui::NativeTheme::instance();
1909 } 1914 }
1910 1915
1911 } // namespace views 1916 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698