| OLD | NEW |
| 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/corewm/cursor_height_provider_win.h" | 5 #include "ui/views/corewm/cursor_height_provider_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 8 #include <algorithm> | 10 #include <algorithm> |
| 9 #include <map> | 11 #include <map> |
| 10 | 12 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/win/scoped_hdc.h" | 14 #include "base/win/scoped_hdc.h" |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 using PixelData = scoped_ptr<uint32_t[]>; | 17 using PixelData = scoped_ptr<uint32_t[]>; |
| 17 using HeightStorage = std::map<HCURSOR, int>; | 18 using HeightStorage = std::map<HCURSOR, int>; |
| 18 | 19 |
| 19 const uint32_t kBitsPeruint32 = sizeof(uint32_t) * 8; | 20 const uint32_t kBitsPeruint32 = sizeof(uint32_t) * 8; |
| 20 // All bits are 1 for transparent portion of monochromatic mask. | 21 // All bits are 1 for transparent portion of monochromatic mask. |
| 21 const uint32_t kTransparentMask = 0xffffffff; | 22 const uint32_t kTransparentMask = 0xffffffff; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 return cached_height->second; | 168 return cached_height->second; |
| 168 | 169 |
| 169 const int height = CalculateCursorHeight(cursor.hCursor); | 170 const int height = CalculateCursorHeight(cursor.hCursor); |
| 170 (*cached_heights)[cursor.hCursor] = height; | 171 (*cached_heights)[cursor.hCursor] = height; |
| 171 | 172 |
| 172 return height; | 173 return height; |
| 173 } | 174 } |
| 174 | 175 |
| 175 } // namespace corewm | 176 } // namespace corewm |
| 176 } // namespace views | 177 } // namespace views |
| OLD | NEW |