diff options
Diffstat (limited to 'ui')
29 files changed, 153 insertions, 153 deletions
diff --git a/ui/base/dragdrop/drag_utils.cc b/ui/base/dragdrop/drag_utils.cc index 9e1bad51..8aee787 100644 --- a/ui/base/dragdrop/drag_utils.cc +++ b/ui/base/dragdrop/drag_utils.cc @@ -41,7 +41,7 @@ void CreateDragImageForFile(const FilePath& file_name, gfx::Canvas canvas(gfx::Size(width, height), false /* translucent */); // Paint the icon. - canvas.DrawBitmapInt(*icon, (width - icon->width()) / 2, 0); + canvas.DrawImageInt(*icon, (width - icon->width()) / 2, 0); string16 name = file_name.BaseName().LossyDisplayName(); const int flags = gfx::Canvas::TEXT_ALIGN_CENTER; diff --git a/ui/base/native_theme/native_theme_android.cc b/ui/base/native_theme/native_theme_android.cc index 7025e8f..354bd0f 100644 --- a/ui/base/native_theme/native_theme_android.cc +++ b/ui/base/native_theme/native_theme_android.cc @@ -295,7 +295,7 @@ void NativeThemeAndroid::PaintCheckbox(SkCanvas* canvas, } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); - DrawBitmapInt(canvas, *image, 0, 0, image->width(), image->height(), + DrawImageInt(canvas, *image, 0, 0, image->width(), image->height(), bounds.x(), bounds.y(), bounds.width(), bounds.height()); } @@ -316,7 +316,7 @@ void NativeThemeAndroid::PaintRadio(SkCanvas* canvas, } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); - DrawBitmapInt(canvas, *image, 0, 0, image->width(), image->height(), + DrawImageInt(canvas, *image, 0, 0, image->width(), image->height(), bounds.x(), bounds.y(), bounds.width(), bounds.height()); } @@ -631,14 +631,14 @@ void NativeThemeAndroid::PaintProgressBar( int dest_left_border_width = static_cast<int>(left_border_image->width() * tile_scale); - DrawBitmapInt(canvas, *left_border_image, 0, 0, left_border_image->width(), + DrawImageInt(canvas, *left_border_image, 0, 0, left_border_image->width(), left_border_image->height(), rect.x(), rect.y(), dest_left_border_width, rect.height()); int dest_right_border_width = static_cast<int>(right_border_image->width() * tile_scale); int dest_x = rect.right() - dest_right_border_width; - DrawBitmapInt(canvas, *right_border_image, 0, 0, right_border_image->width(), + DrawImageInt(canvas, *right_border_image, 0, 0, right_border_image->width(), right_border_image->height(), dest_x, rect.y(), dest_right_border_width, rect.height()); } @@ -654,7 +654,7 @@ bool NativeThemeAndroid::IntersectsClipRectInt(SkCanvas* canvas, SkIntToScalar(y + h)); } -void NativeThemeAndroid::DrawBitmapInt(SkCanvas* canvas, +void NativeThemeAndroid::DrawImageInt(SkCanvas* canvas, const gfx::ImageSkia& image, int src_x, int src_y, @@ -664,7 +664,7 @@ void NativeThemeAndroid::DrawBitmapInt(SkCanvas* canvas, int dest_y, int dest_w, int dest_h) const { - gfx::Canvas(canvas).DrawBitmapInt(image, src_x, src_y, src_w, src_h, + gfx::Canvas(canvas).DrawImageInt(image, src_x, src_y, src_w, src_h, dest_x, dest_y, dest_w, dest_h, true); } diff --git a/ui/base/native_theme/native_theme_android.h b/ui/base/native_theme/native_theme_android.h index 04c7be3..8320f51 100644 --- a/ui/base/native_theme/native_theme_android.h +++ b/ui/base/native_theme/native_theme_android.h @@ -115,16 +115,16 @@ class NativeThemeAndroid : public NativeTheme { // Draw the dest rectangle with the given image which might be scaled if its // size is not same as target rectangle. - void DrawBitmapInt(SkCanvas* canvas, - const gfx::ImageSkia& image, - int src_x, - int src_y, - int src_w, - int src_h, - int dest_x, - int dest_y, - int dest_w, - int dest_h) const; + void DrawImageInt(SkCanvas* canvas, + const gfx::ImageSkia& image, + int src_x, + int src_y, + int src_w, + int src_h, + int dest_x, + int dest_y, + int dest_w, + int dest_h) const; // Draw the target rectangle with the |bitmap| accroding the given // |tile_scale_x| and |tile_scale_y| diff --git a/ui/base/native_theme/native_theme_base.cc b/ui/base/native_theme/native_theme_base.cc index 7a446fa..c2b9f5d 100644 --- a/ui/base/native_theme/native_theme_base.cc +++ b/ui/base/native_theme/native_theme_base.cc @@ -461,7 +461,7 @@ void NativeThemeBase::PaintCheckbox(SkCanvas* canvas, } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); - DrawBitmapInt(canvas, *image, 0, 0, image->width(), image->height(), + DrawImageInt(canvas, *image, 0, 0, image->width(), image->height(), bounds.x(), bounds.y(), bounds.width(), bounds.height()); } @@ -482,7 +482,7 @@ void NativeThemeBase::PaintRadio(SkCanvas* canvas, } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); - DrawBitmapInt(canvas, *image, 0, 0, image->width(), image->height(), + DrawImageInt(canvas, *image, 0, 0, image->width(), image->height(), bounds.x(), bounds.y(), bounds.width(), bounds.height()); } @@ -796,16 +796,16 @@ void NativeThemeBase::PaintProgressBar(SkCanvas* canvas, int dest_left_border_width = static_cast<int>(left_border_image->width() * tile_scale); - DrawBitmapInt(canvas, *left_border_image, 0, 0, left_border_image->width(), + DrawImageInt(canvas, *left_border_image, 0, 0, left_border_image->width(), left_border_image->height(), rect.x(), rect.y(), dest_left_border_width, rect.height()); int dest_right_border_width = static_cast<int>(right_border_image->width() * tile_scale); int dest_x = rect.right() - dest_right_border_width; - DrawBitmapInt(canvas, *right_border_image, 0, 0, right_border_image->width(), - right_border_image->height(), dest_x, rect.y(), - dest_right_border_width, rect.height()); + DrawImageInt(canvas, *right_border_image, 0, 0, right_border_image->width(), + right_border_image->height(), dest_x, rect.y(), + dest_right_border_width, rect.height()); } bool NativeThemeBase::IntersectsClipRectInt(SkCanvas* canvas, @@ -816,11 +816,11 @@ bool NativeThemeBase::IntersectsClipRectInt(SkCanvas* canvas, SkIntToScalar(y + h)); } -void NativeThemeBase::DrawBitmapInt( +void NativeThemeBase::DrawImageInt( SkCanvas* canvas, const gfx::ImageSkia& image, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h) const { - gfx::Canvas(canvas).DrawBitmapInt(image, src_x, src_y, src_w, src_h, + gfx::Canvas(canvas).DrawImageInt(image, src_x, src_y, src_w, src_h, dest_x, dest_y, dest_w, dest_h, true); } diff --git a/ui/base/native_theme/native_theme_base.h b/ui/base/native_theme/native_theme_base.h index 5e6096e..92991b5 100644 --- a/ui/base/native_theme/native_theme_base.h +++ b/ui/base/native_theme/native_theme_base.h @@ -128,9 +128,9 @@ class NativeThemeBase : public NativeTheme { bool IntersectsClipRectInt(SkCanvas* canvas, int x, int y, int w, int h) const; - void DrawBitmapInt(SkCanvas* canvas, const gfx::ImageSkia& image, - int src_x, int src_y, int src_w, int src_h, - int dest_x, int dest_y, int dest_w, int dest_h) const; + void DrawImageInt(SkCanvas* canvas, const gfx::ImageSkia& image, + int src_x, int src_y, int src_w, int src_h, + int dest_x, int dest_y, int dest_w, int dest_h) const; void DrawTiledImage(SkCanvas* canvas, const gfx::ImageSkia& image, diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc index f3419fc..5dbb00e 100644 --- a/ui/gfx/canvas.cc +++ b/ui/gfx/canvas.cc @@ -38,7 +38,7 @@ Canvas::Canvas(const SkBitmap& bitmap, bool is_opaque) : owned_canvas_(new skia::PlatformCanvas(bitmap.width(), bitmap.height(), is_opaque)), canvas_(owned_canvas_.get()) { - DrawBitmapInt(bitmap, 0, 0); + DrawImageInt(bitmap, 0, 0); } Canvas::Canvas() @@ -253,14 +253,14 @@ void Canvas::DrawFocusRect(const gfx::Rect& rect) { DrawDashedRect(rect, SK_ColorGRAY); } -void Canvas::DrawBitmapInt(const gfx::ImageSkia& image, int x, int y) { +void Canvas::DrawImageInt(const gfx::ImageSkia& image, int x, int y) { SkPaint paint; - DrawBitmapInt(image, x, y, paint); + DrawImageInt(image, x, y, paint); } -void Canvas::DrawBitmapInt(const gfx::ImageSkia& image, - int x, int y, - const SkPaint& paint) { +void Canvas::DrawImageInt(const gfx::ImageSkia& image, + int x, int y, + const SkPaint& paint) { float bitmap_scale; const SkBitmap& bitmap = GetBitmapToPaint(image, &bitmap_scale); if (bitmap.isNull()) @@ -276,20 +276,20 @@ void Canvas::DrawBitmapInt(const gfx::ImageSkia& image, canvas_->restore(); } -void Canvas::DrawBitmapInt(const gfx::ImageSkia& image, - int src_x, int src_y, int src_w, int src_h, - int dest_x, int dest_y, int dest_w, int dest_h, - bool filter) { +void Canvas::DrawImageInt(const gfx::ImageSkia& image, + int src_x, int src_y, int src_w, int src_h, + int dest_x, int dest_y, int dest_w, int dest_h, + bool filter) { SkPaint p; - DrawBitmapInt(image, src_x, src_y, src_w, src_h, dest_x, dest_y, - dest_w, dest_h, filter, p); + DrawImageInt(image, src_x, src_y, src_w, src_h, dest_x, dest_y, + dest_w, dest_h, filter, p); } -void Canvas::DrawBitmapInt(const gfx::ImageSkia& image, - int src_x, int src_y, int src_w, int src_h, - int dest_x, int dest_y, int dest_w, int dest_h, - bool filter, - const SkPaint& paint) { +void Canvas::DrawImageInt(const gfx::ImageSkia& image, + int src_x, int src_y, int src_w, int src_h, + int dest_x, int dest_y, int dest_w, int dest_h, + bool filter, + const SkPaint& paint) { DLOG_ASSERT(src_x + src_w < std::numeric_limits<int16_t>::max() && src_y + src_h < std::numeric_limits<int16_t>::max()); if (src_w <= 0 || src_h <= 0) { diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h index 5c7bb9f..6780774 100644 --- a/ui/gfx/canvas.h +++ b/ui/gfx/canvas.h @@ -245,16 +245,16 @@ class UI_EXPORT Canvas { // corner of the bitmap is rendered at the specified location. // Parameters are specified relative to current canvas scale not in pixels. // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. - void DrawBitmapInt(const gfx::ImageSkia&, int x, int y); + void DrawImageInt(const gfx::ImageSkia&, int x, int y); // Draws an image with the origin at the specified location, using the // specified paint. The upper left corner of the bitmap is rendered at the // specified location. // Parameters are specified relative to current canvas scale not in pixels. // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. - void DrawBitmapInt(const gfx::ImageSkia& image, - int x, int y, - const SkPaint& paint); + void DrawImageInt(const gfx::ImageSkia& image, + int x, int y, + const SkPaint& paint); // Draws a portion of an image in the specified location. The src parameters // correspond to the region of the bitmap to draw in the region defined @@ -268,15 +268,15 @@ class UI_EXPORT Canvas { // An optional custom SkPaint can be provided. // Parameters are specified relative to current canvas scale not in pixels. // Thus, |x| is 2 pixels if canvas scale = 2 & |x| = 1. - void DrawBitmapInt(const gfx::ImageSkia& image, - int src_x, int src_y, int src_w, int src_h, - int dest_x, int dest_y, int dest_w, int dest_h, - bool filter); - void DrawBitmapInt(const gfx::ImageSkia& image, - int src_x, int src_y, int src_w, int src_h, - int dest_x, int dest_y, int dest_w, int dest_h, - bool filter, - const SkPaint& paint); + void DrawImageInt(const gfx::ImageSkia& image, + int src_x, int src_y, int src_w, int src_h, + int dest_x, int dest_y, int dest_w, int dest_h, + bool filter); + void DrawImageInt(const gfx::ImageSkia& image, + int src_x, int src_y, int src_w, int src_h, + int dest_x, int dest_y, int dest_w, int dest_h, + bool filter, + const SkPaint& paint); // Draws text with the specified color, font and location. The text is // aligned to the left, vertically centered, clipped to the region. If the diff --git a/ui/gfx/canvas_linux.cc b/ui/gfx/canvas_linux.cc index 576eed2..9d417c9 100644 --- a/ui/gfx/canvas_linux.cc +++ b/ui/gfx/canvas_linux.cc @@ -157,7 +157,7 @@ void DrawStringContext::DrawWithHalo(SkColor text_color, const SkBitmap& text_bitmap = const_cast<SkBitmap&>( skia::GetTopDevice(*text_canvas.sk_canvas())->accessBitmap(false)); - canvas_->DrawBitmapInt(text_bitmap, text_rect_.x() - 1, text_rect_.y() - 1); + canvas_->DrawImageInt(text_bitmap, text_rect_.x() - 1, text_rect_.y() - 1); } void DrawStringContext::DrawUnderline(cairo_t* cr, double extra_edge_width) { diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc index 5c51481..003b2d1 100644 --- a/ui/gfx/canvas_skia.cc +++ b/ui/gfx/canvas_skia.cc @@ -396,7 +396,7 @@ void Canvas::DrawStringWithHalo(const string16& text, } // Draw the halo bitmap with blur. - DrawBitmapInt(text_bitmap, x - 1, y - 1); + DrawImageInt(text_bitmap, x - 1, y - 1); } // TODO(asvitkine): Remove the ifdef once all platforms use canvas_skia.cc. diff --git a/ui/gfx/canvas_win.cc b/ui/gfx/canvas_win.cc index 6e1249a..f38dccc 100644 --- a/ui/gfx/canvas_win.cc +++ b/ui/gfx/canvas_win.cc @@ -455,7 +455,7 @@ void Canvas::DrawStringWithHalo(const string16& text, } // Draw the halo bitmap with blur. - DrawBitmapInt(text_bitmap, x - 1, y - 1); + DrawImageInt(text_bitmap, x - 1, y - 1); } void Canvas::DrawFadeTruncatingString( diff --git a/ui/views/bubble/bubble_border.cc b/ui/views/bubble/bubble_border.cc index 6f550d5..3b4f03d 100644 --- a/ui/views/bubble/bubble_border.cc +++ b/ui/views/bubble/bubble_border.cc @@ -324,7 +324,7 @@ void BubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) const { } // Top left corner. - canvas->DrawBitmapInt(*images_->top_left, left, top); + canvas->DrawImageInt(*images_->top_left, left, top); // Top edge. if (arrow_location_ == TOP_LEFT || arrow_location_ == TOP_RIGHT) { @@ -353,7 +353,7 @@ void BubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) const { } // Top right corner. - canvas->DrawBitmapInt(*images_->top_right, right - tr_width, top); + canvas->DrawImageInt(*images_->top_right, right - tr_width, top); // Right edge. if (arrow_location_ == RIGHT_TOP || arrow_location_ == RIGHT_BOTTOM) { @@ -384,9 +384,9 @@ void BubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) const { } // Bottom right corner. - canvas->DrawBitmapInt(*images_->bottom_right, - right - br_width, - bottom - br_height); + canvas->DrawImageInt(*images_->bottom_right, + right - br_width, + bottom - br_height); // Bottom edge. if (arrow_location_ == BOTTOM_LEFT || arrow_location_ == BOTTOM_RIGHT) { @@ -417,7 +417,7 @@ void BubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) const { } // Bottom left corner. - canvas->DrawBitmapInt(*images_->bottom_left, left, bottom - bl_height); + canvas->DrawImageInt(*images_->bottom_left, left, bottom - bl_height); } void BubbleBorder::DrawEdgeWithArrow(gfx::Canvas* canvas, @@ -446,7 +446,7 @@ void BubbleBorder::DrawEdgeWithArrow(gfx::Canvas* canvas, is_horizontal ? edge->height() : before_arrow); } - canvas->DrawBitmapInt(*arrow, + canvas->DrawImageInt(*arrow, start_x + (is_horizontal ? before_arrow : offset), start_y + (is_horizontal ? offset : before_arrow)); diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc index 729e848..a9d15fc 100644 --- a/ui/views/controls/button/image_button.cc +++ b/ui/views/controls/button/image_button.cc @@ -92,12 +92,12 @@ void ImageButton::OnPaint(gfx::Canvas* canvas) { y = height() - img.height(); if (!background_image_.empty()) - canvas->DrawBitmapInt(background_image_, x, y); + canvas->DrawImageInt(background_image_, x, y); - canvas->DrawBitmapInt(img, x, y); + canvas->DrawImageInt(img, x, y); if (!overlay_image_.empty()) - canvas->DrawBitmapInt(overlay_image_, x, y); + canvas->DrawImageInt(overlay_image_, x, y); } OnPaintFocusBorder(canvas); } diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc index a9aeb5b..156480c 100644 --- a/ui/views/controls/button/menu_button.cc +++ b/ui/views/controls/button/menu_button.cc @@ -153,7 +153,7 @@ void MenuButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { menu_marker_->width(), menu_marker_->height()); arrow_bounds.set_x(GetMirroredXForRect(arrow_bounds)); - canvas->DrawBitmapInt(*menu_marker_, arrow_bounds.x(), arrow_bounds.y()); + canvas->DrawImageInt(*menu_marker_, arrow_bounds.x(), arrow_bounds.y()); } } diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc index bb3aa59..bfa45e7 100644 --- a/ui/views/controls/button/text_button.cc +++ b/ui/views/controls/button/text_button.cc @@ -166,24 +166,24 @@ void TextButtonBorder::Paint(const View& view, int br_width = set.bottom_right->width(); int br_height = set.bottom_right->height(); - canvas->DrawBitmapInt(*set.top_left, 0, 0); - canvas->DrawBitmapInt(*set.top, 0, 0, set.top->width(), t_height, tl_width, 0, + canvas->DrawImageInt(*set.top_left, 0, 0); + canvas->DrawImageInt(*set.top, 0, 0, set.top->width(), t_height, tl_width, 0, width - tl_width - set.top_right->width(), t_height, false); - canvas->DrawBitmapInt(*set.top_right, width - set.top_right->width(), 0); - canvas->DrawBitmapInt(*set.left, 0, 0, l_width, set.left->height(), 0, + canvas->DrawImageInt(*set.top_right, width - set.top_right->width(), 0); + canvas->DrawImageInt(*set.left, 0, 0, l_width, set.left->height(), 0, tl_height, tl_width, height - tl_height - bl_height, false); - canvas->DrawBitmapInt(*set.center, 0, 0, set.center->width(), + canvas->DrawImageInt(*set.center, 0, 0, set.center->width(), set.center->height(), l_width, t_height, width - l_width - r_width, height - t_height - b_height, false); - canvas->DrawBitmapInt(*set.right, 0, 0, r_width, set.right->height(), - width - r_width, tr_height, r_width, - height - tr_height - br_height, false); - canvas->DrawBitmapInt(*set.bottom_left, 0, height - bl_height); - canvas->DrawBitmapInt(*set.bottom, 0, 0, set.bottom->width(), b_height, - bl_width, height - b_height, - width - bl_width - br_width, b_height, false); - canvas->DrawBitmapInt(*set.bottom_right, width - br_width, - height - br_height); + canvas->DrawImageInt(*set.right, 0, 0, r_width, set.right->height(), + width - r_width, tr_height, r_width, + height - tr_height - br_height, false); + canvas->DrawImageInt(*set.bottom_left, 0, height - bl_height); + canvas->DrawImageInt(*set.bottom, 0, 0, set.bottom->width(), b_height, + bl_width, height - b_height, + width - bl_width - br_width, b_height, false); + canvas->DrawImageInt(*set.bottom_right, width - br_width, + height - br_height); } void TextButtonBorder::GetInsets(gfx::Insets* insets) const { @@ -744,7 +744,7 @@ void TextButton::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { // Mirroring the icon position if necessary. gfx::Rect icon_bounds(icon_x, icon_y, icon.width(), icon.height()); icon_bounds.set_x(GetMirroredXForRect(icon_bounds)); - canvas->DrawBitmapInt(icon, icon_bounds.x(), icon_bounds.y()); + canvas->DrawImageInt(icon, icon_bounds.x(), icon_bounds.y()); } } diff --git a/ui/views/controls/combobox/native_combobox_views.cc b/ui/views/controls/combobox/native_combobox_views.cc index 4bd17a3..fa5ee44 100644 --- a/ui/views/controls/combobox/native_combobox_views.cc +++ b/ui/views/controls/combobox/native_combobox_views.cc @@ -301,7 +301,7 @@ void NativeComboboxViews::PaintText(gfx::Canvas* canvas) { disclosure_arrow_->width(), disclosure_arrow_->height()); AdjustBoundsForRTLUI(&arrow_bounds); - canvas->DrawBitmapInt(*disclosure_arrow_, arrow_bounds.x(), arrow_bounds.y()); + canvas->DrawImageInt(*disclosure_arrow_, arrow_bounds.x(), arrow_bounds.y()); canvas->Restore(); } diff --git a/ui/views/controls/glow_hover_controller.cc b/ui/views/controls/glow_hover_controller.cc index f3b356b..88aee71 100644 --- a/ui/views/controls/glow_hover_controller.cc +++ b/ui/views/controls/glow_hover_controller.cc @@ -98,8 +98,8 @@ void GlowHoverController::Draw(gfx::Canvas* canvas, } gfx::ImageSkia result = SkBitmapOperations::CreateMaskedBitmap( hover_canvas.ExtractBitmap(), mask_image); - canvas->DrawBitmapInt(result, (view_->width() - mask_image.width()) / 2, - (view_->height() - mask_image.height()) / 2); + canvas->DrawImageInt(result, (view_->width() - mask_image.width()) / 2, + (view_->height() - mask_image.height()) / 2); } void GlowHoverController::AnimationEnded(const ui::Animation* animation) { diff --git a/ui/views/controls/image_view.cc b/ui/views/controls/image_view.cc index bf8043d..ea63a6d 100644 --- a/ui/views/controls/image_view.cc +++ b/ui/views/controls/image_view.cc @@ -121,11 +121,11 @@ void ImageView::OnPaint(gfx::Canvas* canvas) { // Resize case SkPaint paint; paint.setFilterBitmap(true); - canvas->DrawBitmapInt(image_, 0, 0, image_.width(), image_.height(), + canvas->DrawImageInt(image_, 0, 0, image_.width(), image_.height(), image_bounds.x(), image_bounds.y(), image_bounds.width(), image_bounds.height(), true, paint); } else { - canvas->DrawBitmapInt(image_, image_bounds.x(), image_bounds.y()); + canvas->DrawImageInt(image_, image_bounds.x(), image_bounds.y()); } } diff --git a/ui/views/controls/menu/menu_image_util.cc b/ui/views/controls/menu/menu_image_util.cc index d5a8be2..bac396b 100644 --- a/ui/views/controls/menu/menu_image_util.cc +++ b/ui/views/controls/menu/menu_image_util.cc @@ -89,7 +89,7 @@ gfx::ImageSkia* GetRtlSubmenuArrowImage() { const gfx::ImageSkia* r = rb.GetImageNamed(IDR_MENU_ARROW).ToImageSkia(); gfx::Canvas canvas(gfx::Size(r->width(), r->height()), false); canvas.Scale(-1, 1); - canvas.DrawBitmapInt(*r, - r->width(), 0); + canvas.DrawImageInt(*r, - r->width(), 0); kRtlArrow = new gfx::ImageSkia(canvas.ExtractBitmap()); } return kRtlArrow; diff --git a/ui/views/controls/menu/menu_item_view_views.cc b/ui/views/controls/menu/menu_item_view_views.cc index 1ed2bd8..720c24e 100644 --- a/ui/views/controls/menu/menu_item_view_views.cc +++ b/ui/views/controls/menu/menu_item_view_views.cc @@ -50,7 +50,7 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { // Don't use config.check_width here as it's padded to force more padding. gfx::Rect check_bounds(icon_x, icon_y, check->width(), icon_height); AdjustBoundsForRTLUI(&check_bounds); - canvas->DrawBitmapInt(*check, check_bounds.x(), check_bounds.y()); + canvas->DrawImageInt(*check, check_bounds.x(), check_bounds.y()); } else if (type_ == RADIO) { const gfx::ImageSkia* image = GetRadioButtonImage(GetDelegate()->IsItemChecked(GetCommand())); @@ -61,7 +61,7 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { image->width(), image->height()); AdjustBoundsForRTLUI(&radio_bounds); - canvas->DrawBitmapInt(*image, radio_bounds.x(), radio_bounds.y()); + canvas->DrawImageInt(*image, radio_bounds.x(), radio_bounds.y()); } // Render the foreground. @@ -96,9 +96,9 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { if (!enabled()) { SkPaint paint; paint.setAlpha(120); - canvas->DrawBitmapInt(icon_, icon_bounds.x(), icon_bounds.y(), paint); + canvas->DrawImageInt(icon_, icon_bounds.x(), icon_bounds.y(), paint); } else { - canvas->DrawBitmapInt(icon_, icon_bounds.x(), icon_bounds.y()); + canvas->DrawImageInt(icon_, icon_bounds.x(), icon_bounds.y()); } } @@ -110,8 +110,8 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { config.arrow_width) / 2, config.arrow_width, height()); AdjustBoundsForRTLUI(&arrow_bounds); - canvas->DrawBitmapInt(*GetSubmenuArrowImage(), - arrow_bounds.x(), arrow_bounds.y()); + canvas->DrawImageInt(*GetSubmenuArrowImage(), + arrow_bounds.x(), arrow_bounds.y()); } } diff --git a/ui/views/controls/menu/menu_item_view_win.cc b/ui/views/controls/menu/menu_item_view_win.cc index bca528a..6f9063a 100644 --- a/ui/views/controls/menu/menu_item_view_win.cc +++ b/ui/views/controls/menu/menu_item_view_win.cc @@ -111,7 +111,7 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { icon_.width(), icon_.height()); icon_bounds.set_x(GetMirroredXForRect(icon_bounds)); - canvas->DrawBitmapInt(icon_, icon_bounds.x(), icon_bounds.y()); + canvas->DrawImageInt(icon_, icon_bounds.x(), icon_bounds.y()); } if (HasSubmenu()) { diff --git a/ui/views/controls/scrollbar/bitmap_scroll_bar.cc b/ui/views/controls/scrollbar/bitmap_scroll_bar.cc index 6caaac0..fbd2835 100644 --- a/ui/views/controls/scrollbar/bitmap_scroll_bar.cc +++ b/ui/views/controls/scrollbar/bitmap_scroll_bar.cc @@ -118,19 +118,19 @@ class BitmapScrollBarThumb : public BaseScrollBarThumb { protected: // View overrides: virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { - canvas->DrawBitmapInt(*start_cap_image(), 0, 0); + canvas->DrawImageInt(*start_cap_image(), 0, 0); int top_cap_height = start_cap_image()->height(); int bottom_cap_height = end_cap_image()->height(); int thumb_body_height = height() - top_cap_height - bottom_cap_height; canvas->TileImageInt(*background_image(), 0, top_cap_height, background_image()->width(), thumb_body_height); - canvas->DrawBitmapInt(*end_cap_image(), 0, - height() - bottom_cap_height); + canvas->DrawImageInt(*end_cap_image(), 0, + height() - bottom_cap_height); // Paint the grippy over the track. int grippy_x = (width() - grippy_image()->width()) / 2; int grippy_y = (thumb_body_height - grippy_image()->height()) / 2; - canvas->DrawBitmapInt(*grippy_image(), grippy_x, grippy_y); + canvas->DrawImageInt(*grippy_image(), grippy_x, grippy_y); } private: diff --git a/ui/views/controls/table/table_view_views.cc b/ui/views/controls/table/table_view_views.cc index bc27412..b740ac8 100644 --- a/ui/views/controls/table/table_view_views.cc +++ b/ui/views/controls/table/table_view_views.cc @@ -252,7 +252,7 @@ void TableView::OnPaint(gfx::Canvas* canvas) { gfx::ImageSkia image = model_->GetIcon(i); if (!image.isNull()) { int image_x = GetMirroredXWithWidthInView(text_x, image.width()); - canvas->DrawBitmapInt( + canvas->DrawImageInt( image, 0, 0, image.width(), image.height(), image_x, row_bounds.y() + (row_bounds.height() - kImageSize) / 2, kImageSize, kImageSize, true); diff --git a/ui/views/controls/table/table_view_win.cc b/ui/views/controls/table/table_view_win.cc index 5ed8725..e9b8765 100644 --- a/ui/views/controls/table/table_view_win.cc +++ b/ui/views/controls/table/table_view_win.cc @@ -1264,7 +1264,7 @@ LRESULT TableView::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) { SkXfermode::kSrc_Mode); // + 1 for padding (we declared the image as 18x18 in the list- // view when they are 16x16 so we get an extra pixel of padding). - canvas.DrawBitmapInt(image, 0, 0, + canvas.DrawImageInt(image, 0, 0, image.width(), image.height(), 1, 1, gfx::kFaviconSize, gfx::kFaviconSize, true); diff --git a/ui/views/controls/throbber.cc b/ui/views/controls/throbber.cc index 831d0d9..9cb6e40 100644 --- a/ui/views/controls/throbber.cc +++ b/ui/views/controls/throbber.cc @@ -83,10 +83,10 @@ void Throbber::OnPaint(gfx::Canvas* canvas) { int image_size = frames_->height(); int image_offset = current_frame * image_size; - canvas->DrawBitmapInt(*frames_, - image_offset, 0, image_size, image_size, - 0, 0, image_size, image_size, - false); + canvas->DrawImageInt(*frames_, + image_offset, 0, image_size, image_size, + 0, 0, image_size, image_size, + false); } @@ -162,7 +162,7 @@ void CheckmarkThrobber::OnPaint(gfx::Canvas* canvas) { if (checked_) { int checkmark_x = (width() - checkmark_->width()) / 2; int checkmark_y = (height() - checkmark_->height()) / 2; - canvas->DrawBitmapInt(*checkmark_, checkmark_x, checkmark_y); + canvas->DrawImageInt(*checkmark_, checkmark_x, checkmark_y); } } diff --git a/ui/views/controls/tree/tree_view_views.cc b/ui/views/controls/tree/tree_view_views.cc index 3e84dd9..b13080e 100644 --- a/ui/views/controls/tree/tree_view_views.cc +++ b/ui/views/controls/tree/tree_view_views.cc @@ -653,7 +653,7 @@ void TreeView::PaintRow(gfx::Canvas* canvas, icon_x = bounds.right() - icon_x - open_icon_.width(); else icon_x += bounds.x(); - canvas->DrawBitmapInt( + canvas->DrawImageInt( icon, icon_x, bounds.y() + (bounds.height() - icon.height()) / 2); diff --git a/ui/views/controls/tree/tree_view_win.cc b/ui/views/controls/tree/tree_view_win.cc index 3f982fc..5a81519 100644 --- a/ui/views/controls/tree/tree_view_win.cc +++ b/ui/views/controls/tree/tree_view_win.cc @@ -696,7 +696,7 @@ HIMAGELIST TreeView::CreateImageList() { // Draw our icons into this canvas. int height_offset = (height - model_images[i].height()) / 2; int width_offset = (width - model_images[i].width()) / 2; - canvas.DrawBitmapInt(model_images[i], width_offset, height_offset); + canvas.DrawImageInt(model_images[i], width_offset, height_offset); model_icon = IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap()); } else { model_icon = IconUtil::CreateHICONFromSkBitmap(model_images[i]); diff --git a/ui/views/painter.cc b/ui/views/painter.cc index e790888..96d063d 100644 --- a/ui/views/painter.cc +++ b/ui/views/painter.cc @@ -75,32 +75,32 @@ class ImagePainter : public Painter { virtual void Paint(gfx::Canvas* canvas, const gfx::Size& size) OVERRIDE { if (size.width() == image_.width() && size.height() == image_.height()) { // Early out if the size we're to render at equals the size of the image. - canvas->DrawBitmapInt(image_, 0, 0); + canvas->DrawImageInt(image_, 0, 0); return; } // Upper left. - canvas->DrawBitmapInt(image_, 0, 0, insets_.left(), insets_.top(), - 0, 0, insets_.left(), insets_.top(), true); + canvas->DrawImageInt(image_, 0, 0, insets_.left(), insets_.top(), + 0, 0, insets_.left(), insets_.top(), true); // Top edge. - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, insets_.left(), 0, image_.width() - insets_.width(), insets_.top(), insets_.left(), 0, size.width() - insets_.width(), insets_.top(), true); // Upper right. - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, image_.width() - insets_.right(), 0, insets_.right(), insets_.top(), size.width() - insets_.right(), 0, insets_.right(), insets_.top(), true); // Right edge. - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, image_.width() - insets_.right(), insets_.top(), insets_.right(), image_.height() - insets_.height(), size.width() - insets_.right(), insets_.top(), insets_.right(), size.height() - insets_.height(), true); // Bottom right. - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, image_.width() - insets_.right(), image_.height() - insets_.bottom(), insets_.right(), insets_.bottom(), @@ -108,7 +108,7 @@ class ImagePainter : public Painter { size.height() - insets_.bottom(), insets_.right(), insets_.bottom(), true); // Bottom edge. - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, insets_.left(), image_.height() - insets_.bottom(), image_.width() - insets_.width(), insets_.bottom(), @@ -116,21 +116,21 @@ class ImagePainter : public Painter { size.width() - insets_.width(), insets_.bottom(), true); // Bottom left. - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, 0, image_.height() - insets_.bottom(), insets_.left(), insets_.bottom(), 0, size.height() - insets_.bottom(), insets_.left(), insets_.bottom(), true); // Left. - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, 0, insets_.top(), insets_.left(), image_.height() - insets_.height(), 0, insets_.top(), insets_.left(), size.height() - insets_.height(), true); // Center. if (paint_center_) { - canvas->DrawBitmapInt( + canvas->DrawImageInt( image_, insets_.left(), insets_.top(), image_.width() - insets_.width(), image_.height() - insets_.height(), @@ -193,9 +193,9 @@ void HorizontalPainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) { // No room to paint. return; } - canvas->DrawBitmapInt(*images_[LEFT], 0, 0); - canvas->DrawBitmapInt(*images_[RIGHT], - size.width() - images_[RIGHT]->width(), 0); + canvas->DrawImageInt(*images_[LEFT], 0, 0); + canvas->DrawImageInt(*images_[RIGHT], + size.width() - images_[RIGHT]->width(), 0); canvas->TileImageInt(*images_[CENTER], images_[LEFT]->width(), 0, size.width() - images_[LEFT]->width() - images_[RIGHT]->width(), height_); } diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc index 44cf9c7..478ae33 100644 --- a/ui/views/window/custom_frame_view.cc +++ b/ui/views/window/custom_frame_view.cc @@ -396,11 +396,11 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { // Top. int top_edge_y = client_area_top - top->height(); - canvas->DrawBitmapInt(*top_left, client_area_bounds.x() - top_left->width(), - top_edge_y); + canvas->DrawImageInt(*top_left, client_area_bounds.x() - top_left->width(), + top_edge_y); canvas->TileImageInt(*top, client_area_bounds.x(), top_edge_y, client_area_bounds.width(), top->height()); - canvas->DrawBitmapInt(*top_right, client_area_bounds.right(), top_edge_y); + canvas->DrawImageInt(*top_right, client_area_bounds.right(), top_edge_y); // Right. int client_area_bottom = @@ -410,11 +410,11 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { right->width(), client_area_height); // Bottom. - canvas->DrawBitmapInt(*bottom_right, client_area_bounds.right(), - client_area_bottom); + canvas->DrawImageInt(*bottom_right, client_area_bounds.right(), + client_area_bottom); canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, client_area_bounds.width(), bottom_right->height()); - canvas->DrawBitmapInt(*bottom_left, + canvas->DrawImageInt(*bottom_left, client_area_bounds.x() - bottom_left->width(), client_area_bottom); // Left. diff --git a/ui/views/window/frame_background.cc b/ui/views/window/frame_background.cc index 59e205f..111ac25 100644 --- a/ui/views/window/frame_background.cc +++ b/ui/views/window/frame_background.cc @@ -66,17 +66,17 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { // Draw the theme frame overlay, if available. if (theme_overlay_image_) - canvas->DrawBitmapInt(*theme_overlay_image_, 0, 0); + canvas->DrawImageInt(*theme_overlay_image_, 0, 0); // Draw the top corners and edge, scaling the corner images down if they // are too big and relative to the vertical space available. int top_left_height = std::min(top_left_corner_->height(), view->height() - bottom_left_corner_->height()); - canvas->DrawBitmapInt(*top_left_corner_, - 0, 0, top_left_corner_->width(), top_left_height, - 0, 0, top_left_corner_->width(), top_left_height, - false); + canvas->DrawImageInt(*top_left_corner_, + 0, 0, top_left_corner_->width(), top_left_height, + 0, 0, top_left_corner_->width(), top_left_height, + false); canvas->TileImageInt(*top_edge_, top_left_corner_->width(), 0, @@ -85,12 +85,12 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { int top_right_height = std::min(top_right_corner_->height(), view->height() - bottom_right_corner_->height()); - canvas->DrawBitmapInt(*top_right_corner_, - 0, 0, - top_right_corner_->width(), top_right_height, - view->width() - top_right_corner_->width(), 0, - top_right_corner_->width(), top_right_height, - false); + canvas->DrawImageInt(*top_right_corner_, + 0, 0, + top_right_corner_->width(), top_right_height, + view->width() - top_right_corner_->width(), 0, + top_right_corner_->width(), top_right_height, + false); // Right edge. int right_edge_height = @@ -102,9 +102,9 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { right_edge_height); // Bottom corners and edge. - canvas->DrawBitmapInt(*bottom_right_corner_, - view->width() - bottom_right_corner_->width(), - view->height() - bottom_right_corner_->height()); + canvas->DrawImageInt(*bottom_right_corner_, + view->width() - bottom_right_corner_->width(), + view->height() - bottom_right_corner_->height()); canvas->TileImageInt( *bottom_edge_, bottom_left_corner_->width(), @@ -112,8 +112,8 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { view->width() - bottom_left_corner_->width() - bottom_right_corner_->width(), bottom_edge_->height()); - canvas->DrawBitmapInt(*bottom_left_corner_, 0, - view->height() - bottom_left_corner_->height()); + canvas->DrawImageInt(*bottom_left_corner_, 0, + view->height() - bottom_left_corner_->height()); // Left edge. int left_edge_height = @@ -145,9 +145,9 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas, View* view) const { DCHECK(maximized_top_left_ && maximized_top_right_); left_offset = maximized_top_left_->width(); right_offset = maximized_top_right_->width(); - canvas->DrawBitmapInt(*maximized_top_left_, 0, 0); - canvas->DrawBitmapInt(*maximized_top_right_, - view->width() - right_offset, 0); + canvas->DrawImageInt(*maximized_top_left_, 0, 0); + canvas->DrawImageInt(*maximized_top_right_, + view->width() - right_offset, 0); } // Draw the theme frame. @@ -158,7 +158,7 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas, View* view) const { theme_image_->height()); // Draw the theme frame overlay, if available. if (theme_overlay_image_) - canvas->DrawBitmapInt(*theme_overlay_image_, 0, theme_background_y_); + canvas->DrawImageInt(*theme_overlay_image_, 0, theme_background_y_); } void FrameBackground::PaintFrameColor(gfx::Canvas* canvas, View* view) const { |