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

Unified Diff: chrome/browser/ui/views/panels/panel_frame_view.cc

Issue 673623002: Fix regions generation on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build. Created 6 years, 1 month 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/gfx_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/panels/panel_frame_view.cc
diff --git a/chrome/browser/ui/views/panels/panel_frame_view.cc b/chrome/browser/ui/views/panels/panel_frame_view.cc
index aca6c2d6be4ba61e4d28e7d0418c88a55ad717c9..6ebf5399f76557895d5a982a8847e70697eb775b 100644
--- a/chrome/browser/ui/views/panels/panel_frame_view.cc
+++ b/chrome/browser/ui/views/panels/panel_frame_view.cc
@@ -355,10 +355,14 @@ void PanelFrameView::SetWindowCornerStyle(panel::CornerStyle corner_style) {
gfx::Path window_mask;
GetWindowMask(size(), &window_mask);
- base::win::ScopedRegion new_region(gfx::CreateHRGNFromSkPath(window_mask));
-
- if (current_region_result == ERROR ||
- !::EqualRgn(current_region, new_region)) {
+ base::win::ScopedRegion new_region;
+ if (!window_mask.isEmpty())
+ new_region.Set(gfx::CreateHRGNFromSkPath(window_mask));
+
+ const bool has_current_region = current_region != NULL;
+ const bool has_new_region = new_region != NULL;
+ if (has_current_region != has_new_region ||
+ (has_current_region && !::EqualRgn(current_region, new_region))) {
// SetWindowRgn takes ownership of the new_region.
::SetWindowRgn(native_window, new_region.release(), TRUE);
}
« no previous file with comments | « no previous file | ui/gfx/gfx_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698