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

Side by Side Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/download/download_item_view.h" 5 #include "chrome/browser/ui/views/download/download_item_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 x += center_width; 766 x += center_width;
767 PaintBitmaps(canvas, 767 PaintBitmaps(canvas,
768 body_image_set->top_right, body_image_set->right, 768 body_image_set->top_right, body_image_set->right,
769 body_image_set->bottom_right, 769 body_image_set->bottom_right,
770 x, box_y_, box_height_, body_image_set->top_right->width()); 770 x, box_y_, box_height_, body_image_set->top_right->width());
771 771
772 // Overlay our body hot state. 772 // Overlay our body hot state.
773 if (body_hover_animation_->GetCurrentValue() > 0) { 773 if (body_hover_animation_->GetCurrentValue() > 0) {
774 canvas->SaveLayerAlpha( 774 canvas->SaveLayerAlpha(
775 static_cast<int>(body_hover_animation_->GetCurrentValue() * 255)); 775 static_cast<int>(body_hover_animation_->GetCurrentValue() * 255));
776 canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode); 776 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
777 777
778 int x = kLeftPadding; 778 int x = kLeftPadding;
779 PaintBitmaps(canvas, 779 PaintBitmaps(canvas,
780 hot_body_image_set_.top_left, hot_body_image_set_.left, 780 hot_body_image_set_.top_left, hot_body_image_set_.left,
781 hot_body_image_set_.bottom_left, 781 hot_body_image_set_.bottom_left,
782 x, box_y_, box_height_, hot_body_image_set_.top_left->width()); 782 x, box_y_, box_height_, hot_body_image_set_.top_left->width());
783 x += body_image_set->top_left->width(); 783 x += body_image_set->top_left->width();
784 PaintBitmaps(canvas, 784 PaintBitmaps(canvas,
785 hot_body_image_set_.top, hot_body_image_set_.center, 785 hot_body_image_set_.top, hot_body_image_set_.center,
786 hot_body_image_set_.bottom, 786 hot_body_image_set_.bottom,
(...skipping 13 matching lines...) Expand all
800 if (drop_down_image_set) { 800 if (drop_down_image_set) {
801 PaintBitmaps(canvas, 801 PaintBitmaps(canvas,
802 drop_down_image_set->top, drop_down_image_set->center, 802 drop_down_image_set->top, drop_down_image_set->center,
803 drop_down_image_set->bottom, 803 drop_down_image_set->bottom,
804 x, box_y_, box_height_, drop_down_image_set->top->width()); 804 x, box_y_, box_height_, drop_down_image_set->top->width());
805 805
806 // Overlay our drop-down hot state. 806 // Overlay our drop-down hot state.
807 if (drop_hover_animation_->GetCurrentValue() > 0) { 807 if (drop_hover_animation_->GetCurrentValue() > 0) {
808 canvas->SaveLayerAlpha( 808 canvas->SaveLayerAlpha(
809 static_cast<int>(drop_hover_animation_->GetCurrentValue() * 255)); 809 static_cast<int>(drop_hover_animation_->GetCurrentValue() * 255));
810 canvas->AsCanvasSkia()->drawARGB(0, 255, 255, 255, 810 canvas->GetSkCanvas()->drawARGB(0, 255, 255, 255,
811 SkXfermode::kClear_Mode); 811 SkXfermode::kClear_Mode);
812 812
813 PaintBitmaps(canvas, 813 PaintBitmaps(canvas,
814 drop_down_image_set->top, drop_down_image_set->center, 814 drop_down_image_set->top, drop_down_image_set->center,
815 drop_down_image_set->bottom, 815 drop_down_image_set->bottom,
816 x, box_y_, box_height_, drop_down_image_set->top->width()); 816 x, box_y_, box_height_, drop_down_image_set->top->width());
817 817
818 canvas->Restore(); 818 canvas->Restore();
819 } 819 }
820 } 820 }
821 821
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 // If the name has changed, notify assistive technology that the name 1116 // If the name has changed, notify assistive technology that the name
1117 // has changed so they can announce it immediately. 1117 // has changed so they can announce it immediately.
1118 if (new_name != accessible_name_) { 1118 if (new_name != accessible_name_) {
1119 accessible_name_ = new_name; 1119 accessible_name_ = new_name;
1120 if (GetWidget()) { 1120 if (GetWidget()) {
1121 GetWidget()->NotifyAccessibilityEvent( 1121 GetWidget()->NotifyAccessibilityEvent(
1122 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); 1122 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true);
1123 } 1123 }
1124 } 1124 }
1125 } 1125 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698