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

Side by Side Diff: views/controls/menu/native_menu_win.cc

Issue 146131: Update Skia transfer modes to match changes in Skia as of r239 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/menu/menu_win.cc ('k') | views/controls/table/table_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "views/controls/menu/native_menu_win.h" 5 #include "views/controls/menu/native_menu_win.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/font.h" 8 #include "app/gfx/font.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/l10n_util_win.h" 10 #include "app/l10n_util_win.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 DrawTextEx(dc, const_cast<wchar_t*>(accel.data()), 215 DrawTextEx(dc, const_cast<wchar_t*>(accel.data()),
216 static_cast<int>(accel.size()), &rect, 216 static_cast<int>(accel.size()), &rect,
217 format | DT_RIGHT, NULL); 217 format | DT_RIGHT, NULL);
218 SelectObject(dc, old_font); 218 SelectObject(dc, old_font);
219 219
220 // Draw the icon after the label, otherwise it would be covered 220 // Draw the icon after the label, otherwise it would be covered
221 // by the label. 221 // by the label.
222 SkBitmap icon; 222 SkBitmap icon;
223 if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) { 223 if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) {
224 gfx::Canvas canvas(icon.width(), icon.height(), false); 224 gfx::Canvas canvas(icon.width(), icon.height(), false);
225 canvas.drawColor(SK_ColorBLACK, SkPorterDuff::kClear_Mode); 225 canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
226 canvas.DrawBitmapInt(icon, 0, 0); 226 canvas.DrawBitmapInt(icon, 0, 0);
227 canvas.getTopPlatformDevice().drawToHDC(dc, 227 canvas.getTopPlatformDevice().drawToHDC(dc,
228 draw_item_struct->rcItem.left + kItemLeftMargin, 228 draw_item_struct->rcItem.left + kItemLeftMargin,
229 draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - 229 draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom -
230 draw_item_struct->rcItem.top - icon.height()) / 2, NULL); 230 draw_item_struct->rcItem.top - icon.height()) / 2, NULL);
231 } 231 }
232 232
233 } else { 233 } else {
234 // Draw the separator 234 // Draw the separator
235 draw_item_struct->rcItem.top += 235 draw_item_struct->rcItem.top +=
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 531
532 //////////////////////////////////////////////////////////////////////////////// 532 ////////////////////////////////////////////////////////////////////////////////
533 // MenuWrapper, public: 533 // MenuWrapper, public:
534 534
535 // static 535 // static
536 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { 536 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) {
537 return new NativeMenuWin(menu->model(), NULL); 537 return new NativeMenuWin(menu->model(), NULL);
538 } 538 }
539 539
540 } // namespace views 540 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_win.cc ('k') | views/controls/table/table_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698