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

Side by Side Diff: ui/views/controls/tree/tree_view_win.cc

Issue 10790128: Revert 147915 - Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « ui/views/controls/table/table_view_win.cc ('k') | ui/views/widget/native_widget_win.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/controls/tree/tree_view_win.h" 5 #include "ui/views/controls/tree/tree_view_win.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 ImageList_AddIcon(image_list, h_opened_icon); 684 ImageList_AddIcon(image_list, h_opened_icon);
685 DestroyIcon(h_closed_icon); 685 DestroyIcon(h_closed_icon);
686 DestroyIcon(h_opened_icon); 686 DestroyIcon(h_opened_icon);
687 for (size_t i = 0; i < model_images.size(); ++i) { 687 for (size_t i = 0; i < model_images.size(); ++i) {
688 HICON model_icon; 688 HICON model_icon;
689 689
690 // Need to resize the provided icons to be the same size as 690 // Need to resize the provided icons to be the same size as
691 // IDR_FOLDER_CLOSED if they aren't already. 691 // IDR_FOLDER_CLOSED if they aren't already.
692 if (model_images[i].width() != width || 692 if (model_images[i].width() != width ||
693 model_images[i].height() != height) { 693 model_images[i].height() != height) {
694 gfx::Canvas canvas(gfx::Size(width, height), ui::SCALE_FACTOR_100P, 694 gfx::Canvas canvas(gfx::Size(width, height), false);
695 false);
696 695
697 // Draw our icons into this canvas. 696 // Draw our icons into this canvas.
698 int height_offset = (height - model_images[i].height()) / 2; 697 int height_offset = (height - model_images[i].height()) / 2;
699 int width_offset = (width - model_images[i].width()) / 2; 698 int width_offset = (width - model_images[i].width()) / 2;
700 canvas.DrawImageInt(model_images[i], width_offset, height_offset); 699 canvas.DrawImageInt(model_images[i], width_offset, height_offset);
701 model_icon = IconUtil::CreateHICONFromSkBitmap( 700 model_icon = IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap());
702 canvas.ExtractImageRep().sk_bitmap());
703 } else { 701 } else {
704 model_icon = IconUtil::CreateHICONFromSkBitmap(model_images[i]); 702 model_icon = IconUtil::CreateHICONFromSkBitmap(model_images[i]);
705 } 703 }
706 ImageList_AddIcon(image_list, model_icon); 704 ImageList_AddIcon(image_list, model_icon);
707 DestroyIcon(model_icon); 705 DestroyIcon(model_icon);
708 } 706 }
709 } 707 }
710 return image_list; 708 return image_list;
711 } 709 }
712 710
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 } 793 }
796 // Fall through and let the default handler process as well. 794 // Fall through and let the default handler process as well.
797 break; 795 break;
798 } 796 }
799 WNDPROC handler = tree->original_handler_; 797 WNDPROC handler = tree->original_handler_;
800 DCHECK(handler); 798 DCHECK(handler);
801 return CallWindowProc(handler, window, message, w_param, l_param); 799 return CallWindowProc(handler, window, message, w_param, l_param);
802 } 800 }
803 801
804 } // namespace views 802 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/table/table_view_win.cc ('k') | ui/views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698