| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/controls/menu/menu_win.h" | 5 #include "views/controls/menu/menu_win.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlapp.h> | 8 #include <atlapp.h> |
| 9 #include <atlwin.h> | 9 #include <atlwin.h> |
| 10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if (!accel.empty()) | 182 if (!accel.empty()) |
| 183 DrawTextEx(hDC, const_cast<wchar_t*>(accel.data()), | 183 DrawTextEx(hDC, const_cast<wchar_t*>(accel.data()), |
| 184 static_cast<int>(accel.size()), &rect, | 184 static_cast<int>(accel.size()), &rect, |
| 185 format | DT_RIGHT, NULL); | 185 format | DT_RIGHT, NULL); |
| 186 SelectObject(hDC, old_font); | 186 SelectObject(hDC, old_font); |
| 187 | 187 |
| 188 // Draw the icon after the label, otherwise it would be covered | 188 // Draw the icon after the label, otherwise it would be covered |
| 189 // by the label. | 189 // by the label. |
| 190 if (data->icon.width() != 0 && data->icon.height() != 0) { | 190 if (data->icon.width() != 0 && data->icon.height() != 0) { |
| 191 gfx::Canvas canvas(data->icon.width(), data->icon.height(), false); | 191 gfx::Canvas canvas(data->icon.width(), data->icon.height(), false); |
| 192 canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode); | 192 canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); |
| 193 canvas.DrawBitmapInt(data->icon, 0, 0); | 193 canvas.DrawBitmapInt(data->icon, 0, 0); |
| 194 canvas.getTopPlatformDevice().drawToHDC(hDC, lpdis->rcItem.left + | 194 canvas.getTopPlatformDevice().drawToHDC(hDC, lpdis->rcItem.left + |
| 195 kItemLeftMargin, lpdis->rcItem.top + (lpdis->rcItem.bottom - | 195 kItemLeftMargin, lpdis->rcItem.top + (lpdis->rcItem.bottom - |
| 196 lpdis->rcItem.top - data->icon.height()) / 2, NULL); | 196 lpdis->rcItem.top - data->icon.height()) / 2, NULL); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } else { | 199 } else { |
| 200 // Draw the separator | 200 // Draw the separator |
| 201 lpdis->rcItem.top += (lpdis->rcItem.bottom - lpdis->rcItem.top) / 3; | 201 lpdis->rcItem.top += (lpdis->rcItem.bottom - lpdis->rcItem.top) / 3; |
| 202 DrawEdge(hDC, &lpdis->rcItem, EDGE_ETCHED, BF_TOP); | 202 DrawEdge(hDC, &lpdis->rcItem, EDGE_ETCHED, BF_TOP); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 break; | 569 break; |
| 570 | 570 |
| 571 default: | 571 default: |
| 572 NOTREACHED(); | 572 NOTREACHED(); |
| 573 return 0; | 573 return 0; |
| 574 } | 574 } |
| 575 return align_flags; | 575 return align_flags; |
| 576 } | 576 } |
| 577 | 577 |
| 578 } // namespace views | 578 } // namespace views |
| OLD | NEW |