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

Unified Diff: ui/gfx/icon_util.cc

Issue 2423293003: Bug Fix: Cursor Stretched During Tab Capturing On Windows (Closed)
Patch Set: Created 4 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
« 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/gfx/icon_util.cc
diff --git a/ui/gfx/icon_util.cc b/ui/gfx/icon_util.cc
index 1dbf77f6008d92c39aff65b92fa30c575c9dcdcd..54b7ed8b6de031ffd7354a3071a4a0f296d8c9e0 100644
--- a/ui/gfx/icon_util.cc
+++ b/ui/gfx/icon_util.cc
@@ -311,7 +311,12 @@ SkBitmap* IconUtil::CreateSkBitmapFromHICON(HICON icon) {
if (!::GetObject(icon_info.hbmMask, sizeof(bitmap_info), &bitmap_info))
return NULL;
- gfx::Size icon_size(bitmap_info.bmWidth, bitmap_info.bmHeight);
+ // For non-color cursors, the mask contains both an AND and an XOR mask and
+ // the height includes both. Thus, the mask width is the same as image width,
+ // but we need to divide mask height by 2 to get the image height.
+ const int height = (icon_info.hbmColor == NULL) ? bitmap_info.bmHeight / 2
msw 2016/10/20 18:54:51 nit: just check: "icon_info.hbmColor ?" otherwise,
qiangchen 2016/10/20 20:03:33 Done.
msw 2016/10/20 20:06:58 Thanks for catching and fixing the inversion error
+ : bitmap_info.bmHeight;
+ gfx::Size icon_size(bitmap_info.bmWidth, height);
return new SkBitmap(CreateSkBitmapFromHICONHelper(icon, icon_size));
}
« 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