chrome/browser/ui/views/tabs/tab.cc
// Draws the icon image at the center of |bounds|.
Draws the icon image at the center of |bounds|.
Draws the icon image at the center of |bounds| .
void DrawIconCenter(gfx::Canvas* canvas,
                    const gfx::ImageSkia& image,
                    int image_offset,
                    int icon_width,
                    int icon_height,
                    const gfx::Rect& bounds,
                    bool filter,
                    const SkPaint& paint) {
  int dst_x = bounds.x() - (icon_width - bounds.width()) / 2;
  int dst_y = bounds.y() - (icon_height - bounds.height()) / 2;
  canvas->Save();
  canvas->ClipRect(gfx::Rect(dst_x, dst_y, icon_width, icon_height));
  canvas->DrawImageInt(image,
                       image_offset, 0, icon_width, icon_height,
                       dst_x, dst_y, icon_width, icon_height,
                       filter, paint);
  canvas->Restore();
}
void DrawIconCenter ( gfx :: Canvas * canvas , const gfx :: ImageSkia & image , int image_offset , int icon_width , int icon_height , const gfx :: Rect & bounds , bool filter , const SkPaint & paint ) { int dst_x = bounds . x ( ) - ( icon_width - bounds . width ( ) ) / 2 ; int dst_y = bounds . y ( ) - ( icon_height - bounds . height ( ) ) / 2 ; canvas -> Save ( ) ; canvas -> ClipRect ( gfx :: Rect ( dst_x , dst_y , icon_width , icon_height ) ) ; canvas -> DrawImageInt ( image , image_offset , 0 , icon_width , icon_height , dst_x , dst_y , icon_width , icon_height , filter , paint ) ; canvas -> Restore ( ) ; }
Draws the icon image at the center of |bounds|.
Draws the icon image at the center of |bounds| .
// Center the image within bounds. // NOTE: the clipping is a work around for 69528, it shouldn't be necessary.