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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 673623002: Fix regions generation on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CreateHRGNFromSkPath can return empty region now. Created 6 years, 2 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
« ui/gfx/path_win_unittest.cc ('K') | « ui/gfx/path_win_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 1544507ef39740982de458fcff8f71dd0b069b6c..8685e1fe044223f10be3243709a27bf1777573ce 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1133,7 +1133,7 @@ void HWNDMessageHandler::ResetWindowRegion(bool force, bool redraw) {
RECT window_rect;
GetWindowRect(hwnd(), &window_rect);
- HRGN new_region;
+ HRGN new_region = NULL;
Wez 2014/10/27 20:28:39 While you're here, I'd suggest using ScopedRegion
alex-ac 2014/10/28 10:38:36 Done.
if (custom_window_region_) {
new_region = ::CreateRectRgn(0, 0, 0, 0);
::CombineRgn(new_region, custom_window_region_.Get(), NULL, RGN_COPY);
@@ -1150,7 +1150,8 @@ void HWNDMessageHandler::ResetWindowRegion(bool force, bool redraw) {
delegate_->GetWindowMask(gfx::Size(window_rect.right - window_rect.left,
window_rect.bottom - window_rect.top),
&window_mask);
- new_region = gfx::CreateHRGNFromSkPath(window_mask);
+ if (!window_mask.isEmpty())
+ new_region = gfx::CreateHRGNFromSkPath(window_mask);
}
if (current_rgn_result == ERROR || !EqualRgn(current_rgn, new_region)) {
« ui/gfx/path_win_unittest.cc ('K') | « ui/gfx/path_win_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698