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

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

Issue 1011173003: x11: Use gfx::XScopedPtr<> in more places. (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 unified diff | Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/x11_topmost_window_finder.h" 5 #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 #include <X11/extensions/shape.h> 9 #include <X11/extensions/shape.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 SkRegion* skregion1 = new SkRegion; 323 SkRegion* skregion1 = new SkRegion;
324 skregion1->op(SkIRect::MakeXYWH(0, 10, 10, 90), SkRegion::kUnion_Op); 324 skregion1->op(SkIRect::MakeXYWH(0, 10, 10, 90), SkRegion::kUnion_Op);
325 skregion1->op(SkIRect::MakeXYWH(10, 0, 90, 100), SkRegion::kUnion_Op); 325 skregion1->op(SkIRect::MakeXYWH(10, 0, 90, 100), SkRegion::kUnion_Op);
326 // Widget takes ownership of |skregion1|. 326 // Widget takes ownership of |skregion1|.
327 widget1->SetShape(skregion1); 327 widget1->SetShape(skregion1);
328 328
329 SkRegion skregion2; 329 SkRegion skregion2;
330 skregion2.op(SkIRect::MakeXYWH(0, 10, 10, 90), SkRegion::kUnion_Op); 330 skregion2.op(SkIRect::MakeXYWH(0, 10, 10, 90), SkRegion::kUnion_Op);
331 skregion2.op(SkIRect::MakeXYWH(10, 0, 90, 100), SkRegion::kUnion_Op); 331 skregion2.op(SkIRect::MakeXYWH(10, 0, 90, 100), SkRegion::kUnion_Op);
332 XID xid2 = CreateAndShowXWindow(gfx::Rect(300, 100, 100, 100)); 332 XID xid2 = CreateAndShowXWindow(gfx::Rect(300, 100, 100, 100));
333 REGION* region2 = gfx::CreateRegionFromSkRegion(skregion2); 333 gfx::XScopedPtr<REGION, gfx::XObjectDeleter<REGION, int, XDestroyRegion>>
334 XShapeCombineRegion(xdisplay(), xid2, ShapeBounding, 0, 0, region2, 334 region2(gfx::CreateRegionFromSkRegion(skregion2));
335 false); 335 XShapeCombineRegion(xdisplay(), xid2, ShapeBounding, 0, 0, region2.get(),
336 XDestroyRegion(region2); 336 false);
337
338 XID xids[] = { xid1, xid2 }; 337 XID xids[] = { xid1, xid2 };
339 StackingClientListWaiter stack_waiter(xids, arraysize(xids)); 338 StackingClientListWaiter stack_waiter(xids, arraysize(xids));
340 stack_waiter.Wait(); 339 stack_waiter.Wait();
341 ui::X11EventSource::GetInstance()->DispatchXEvents(); 340 ui::X11EventSource::GetInstance()->DispatchXEvents();
342 341
343 EXPECT_EQ(xid1, FindTopmostXWindowAt(105, 120)); 342 EXPECT_EQ(xid1, FindTopmostXWindowAt(105, 120));
344 EXPECT_NE(xid1, FindTopmostXWindowAt(105, 105)); 343 EXPECT_NE(xid1, FindTopmostXWindowAt(105, 105));
345 EXPECT_NE(xid2, FindTopmostXWindowAt(105, 105)); 344 EXPECT_NE(xid2, FindTopmostXWindowAt(105, 105));
346 345
347 // Repeat test for an X window which does not belong to a views::Widget 346 // Repeat test for an X window which does not belong to a views::Widget
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 433
435 EXPECT_EQ(xid, FindTopmostXWindowAt(110, 110)); 434 EXPECT_EQ(xid, FindTopmostXWindowAt(110, 110));
436 EXPECT_EQ(menu_xid, FindTopmostXWindowAt(150, 120)); 435 EXPECT_EQ(menu_xid, FindTopmostXWindowAt(150, 120));
437 EXPECT_EQ(menu_xid, FindTopmostXWindowAt(210, 120)); 436 EXPECT_EQ(menu_xid, FindTopmostXWindowAt(210, 120));
438 437
439 XDestroyWindow(xdisplay(), xid); 438 XDestroyWindow(xdisplay(), xid);
440 XDestroyWindow(xdisplay(), menu_xid); 439 XDestroyWindow(xdisplay(), menu_xid);
441 } 440 }
442 441
443 } // namespace views 442 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698