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

Unified Diff: ui/gfx/icon_util.cc

Issue 2605773002: Fix Aura can't provide accurate cursor hotspot info. (Closed)
Patch Set: Created 4 years 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/base/cursor/cursors_aura.cc ('K') | « ui/gfx/icon_util.h ('k') | 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 2d9bc2164a527eed3fde6b202659e6d05c1cc0b3..f3ef07a7dce44d5ef970f282f304f9156314abf2 100644
--- a/ui/gfx/icon_util.cc
+++ b/ui/gfx/icon_util.cc
@@ -369,6 +369,14 @@ base::win::ScopedHICON IconUtil::CreateCursorFromDIB(const gfx::Size& icon_size,
return base::win::ScopedHICON(CreateIconIndirect(&ii));
}
+gfx::Point IconUtil::GetHotSpotFromHICON(HICON icon) {
+ ScopedICONINFO icon_info;
+ gfx::Point hotspot;
+ if (::GetIconInfo(icon, &icon_info)) {
sadrul 2017/01/03 17:18:09 Don't need {}
braveyao 2017/01/03 17:30:51 Done.
+ hotspot = gfx::Point(icon_info.xHotspot, icon_info.yHotspot);
+ }
+ return hotspot;
+}
SkBitmap IconUtil::CreateSkBitmapFromHICONHelper(HICON icon,
const gfx::Size& s) {
DCHECK(icon);
« ui/base/cursor/cursors_aura.cc ('K') | « ui/gfx/icon_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698