diff options
48 files changed, 456 insertions, 418 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 5c6d03c..4d2e3ca 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -59,9 +59,9 @@ #endif #if defined(TOOLKIT_VIEWS) +#include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/drag_utils.h" #include "ui/base/dragdrop/os_exchange_data.h" -#include "ui/base/dragdrop/drag_drop_types.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" #endif @@ -387,7 +387,7 @@ void DragDownload(const DownloadItem* download, if (icon) { drag_utils::CreateDragImageForFile( - download->GetFileNameToReportUser(), icon->ToSkBitmap(), &data); + download->GetFileNameToReportUser(), icon->ToImageSkia(), &data); } const FilePath full_path = download->GetFullPath(); diff --git a/chrome/browser/ui/panels/panel_browser_frame_view.cc b/chrome/browser/ui/panels/panel_browser_frame_view.cc index 114d13c..a4dfadd 100644 --- a/chrome/browser/ui/panels/panel_browser_frame_view.cc +++ b/chrome/browser/ui/panels/panel_browser_frame_view.cc @@ -578,7 +578,7 @@ bool PanelBrowserFrameView::ShouldTabIconViewAnimate() const { return current_tab ? current_tab->IsLoading() : false; } -SkBitmap PanelBrowserFrameView::GetFaviconForTabIconView() { +gfx::ImageSkia PanelBrowserFrameView::GetFaviconForTabIconView() { return frame()->widget_delegate()->GetWindowIcon(); } diff --git a/chrome/browser/ui/panels/panel_browser_frame_view.h b/chrome/browser/ui/panels/panel_browser_frame_view.h index 3d29fd7..92ad240 100644 --- a/chrome/browser/ui/panels/panel_browser_frame_view.h +++ b/chrome/browser/ui/panels/panel_browser_frame_view.h @@ -82,7 +82,7 @@ class PanelBrowserFrameView : public BrowserNonClientFrameView, // Overridden from TabIconView::TabIconViewModel: virtual bool ShouldTabIconViewAnimate() const OVERRIDE; - virtual SkBitmap GetFaviconForTabIconView() OVERRIDE; + virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; private: friend class PanelBrowserViewTest; diff --git a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc index 5fa52f7..086d2eb 100644 --- a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc @@ -16,8 +16,8 @@ #include "grit/theme_resources.h" #include "grit/theme_resources_standard.h" #include "grit/ui_resources.h" -#include "ui/aura/window.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/window.h" #include "ui/base/accessibility/accessible_view_state.h" #include "ui/base/hit_test.h" #include "ui/base/l10n/l10n_util.h" @@ -341,7 +341,7 @@ bool BrowserNonClientFrameViewAsh::ShouldTabIconViewAnimate() const { return current_tab ? current_tab->IsLoading() : false; } -SkBitmap BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { +gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { views::WidgetDelegate* delegate = frame()->widget_delegate(); if (!delegate) return SkBitmap(); diff --git a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h index d0aa0407..d2a9e7f 100644 --- a/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h +++ b/chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h @@ -60,7 +60,7 @@ class BrowserNonClientFrameViewAsh : public BrowserNonClientFrameView, // Overridden from TabIconView::TabIconViewModel: virtual bool ShouldTabIconViewAnimate() const OVERRIDE; - virtual SkBitmap GetFaviconForTabIconView() OVERRIDE; + virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(BrowserNonClientFrameViewAshTest, UseShortHeader); diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc index 53d479f..0bb36ff 100644 --- a/chrome/browser/ui/views/constrained_window_views.cc +++ b/chrome/browser/ui/views/constrained_window_views.cc @@ -63,7 +63,7 @@ class ClientView; // An enumeration of bitmap resources used by this window. enum { - FRAME_PART_BITMAP_FIRST = 0, // Must be first. + FRAME_PART_IMAGE_FIRST = 0, // Must be first. // Window Frame Border. FRAME_BOTTOM_EDGE, @@ -75,7 +75,7 @@ enum { FRAME_TOP_LEFT_CORNER, FRAME_TOP_RIGHT_CORNER, - FRAME_PART_BITMAP_COUNT // Must be last. + FRAME_PART_IMAGE_COUNT // Must be last. }; static const int kXPFramePartIDs[] = { @@ -100,8 +100,8 @@ class XPWindowResources : public views::WindowResources { } virtual ~XPWindowResources() {} - virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part_id) const { - return bitmaps_[part_id]; + virtual gfx::ImageSkia* GetPartImage(views::FramePartImage part_id) const { + return images_[part_id]; } private: @@ -109,16 +109,16 @@ class XPWindowResources : public views::WindowResources { static bool initialized = false; if (!initialized) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - for (int i = 0; i < FRAME_PART_BITMAP_COUNT; ++i) { + for (int i = 0; i < FRAME_PART_IMAGE_COUNT; ++i) { int id = kXPFramePartIDs[i]; if (id != 0) - bitmaps_[i] = rb.GetBitmapNamed(id); + images_[i] = rb.GetImageSkiaNamed(id); } initialized = true; } } - static SkBitmap* bitmaps_[FRAME_PART_BITMAP_COUNT]; + static gfx::ImageSkia* images_[FRAME_PART_IMAGE_COUNT]; DISALLOW_COPY_AND_ASSIGN(XPWindowResources); }; @@ -130,8 +130,8 @@ class VistaWindowResources : public views::WindowResources { } virtual ~VistaWindowResources() {} - virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part_id) const { - return bitmaps_[part_id]; + virtual gfx::ImageSkia* GetPartImage(views::FramePartImage part_id) const { + return images_[part_id]; } private: @@ -139,22 +139,22 @@ class VistaWindowResources : public views::WindowResources { static bool initialized = false; if (!initialized) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - for (int i = 0; i < FRAME_PART_BITMAP_COUNT; ++i) { + for (int i = 0; i < FRAME_PART_IMAGE_COUNT; ++i) { int id = kVistaFramePartIDs[i]; if (id != 0) - bitmaps_[i] = rb.GetBitmapNamed(id); + images_[i] = rb.GetImageSkiaNamed(id); } initialized = true; } } - static SkBitmap* bitmaps_[FRAME_PART_BITMAP_COUNT]; + static gfx::ImageSkia* images_[FRAME_PART_IMAGE_COUNT]; DISALLOW_COPY_AND_ASSIGN(VistaWindowResources); }; -SkBitmap* XPWindowResources::bitmaps_[]; -SkBitmap* VistaWindowResources::bitmaps_[]; +gfx::ImageSkia* XPWindowResources::images_[]; +gfx::ImageSkia* VistaWindowResources::images_[]; //////////////////////////////////////////////////////////////////////////////// // ConstrainedWindowFrameView @@ -442,21 +442,21 @@ void ConstrainedWindowFrameView::PaintFrameBorder(gfx::Canvas* canvas) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); frame_background_->set_frame_color(ThemeService::GetDefaultColor( ThemeService::COLOR_FRAME)); - SkBitmap* theme_frame = rb.GetBitmapNamed(IDR_THEME_FRAME); - frame_background_->set_theme_bitmap(theme_frame); - frame_background_->set_theme_overlay_bitmap(NULL); + gfx::ImageSkia* theme_frame = rb.GetImageSkiaNamed(IDR_THEME_FRAME); + frame_background_->set_theme_image(theme_frame); + frame_background_->set_theme_overlay_image(NULL); frame_background_->set_top_area_height(theme_frame->height()); frame_background_->SetCornerImages( - resources_->GetPartBitmap(FRAME_TOP_LEFT_CORNER), - resources_->GetPartBitmap(FRAME_TOP_RIGHT_CORNER), - resources_->GetPartBitmap(FRAME_BOTTOM_LEFT_CORNER), - resources_->GetPartBitmap(FRAME_BOTTOM_RIGHT_CORNER)); + resources_->GetPartImage(FRAME_TOP_LEFT_CORNER), + resources_->GetPartImage(FRAME_TOP_RIGHT_CORNER), + resources_->GetPartImage(FRAME_BOTTOM_LEFT_CORNER), + resources_->GetPartImage(FRAME_BOTTOM_RIGHT_CORNER)); frame_background_->SetSideImages( - resources_->GetPartBitmap(FRAME_LEFT_EDGE), - resources_->GetPartBitmap(FRAME_TOP_EDGE), - resources_->GetPartBitmap(FRAME_RIGHT_EDGE), - resources_->GetPartBitmap(FRAME_BOTTOM_EDGE)); + resources_->GetPartImage(FRAME_LEFT_EDGE), + resources_->GetPartImage(FRAME_TOP_EDGE), + resources_->GetPartImage(FRAME_RIGHT_EDGE), + resources_->GetPartImage(FRAME_BOTTOM_EDGE)); frame_background_->PaintRestored(canvas, this); } diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc index d583cf3..14e8ccd 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc @@ -70,11 +70,11 @@ class AppNonClientFrameViewAura::ControlView int control_base_resource_id = owner->browser_view()->IsOffTheRecord() ? IDR_AURA_WINDOW_HEADER_BASE_INCOGNITO_ACTIVE : IDR_AURA_WINDOW_HEADER_BASE_ACTIVE; - control_base_ = rb.GetImageNamed(control_base_resource_id).ToSkBitmap(); + control_base_ = rb.GetImageNamed(control_base_resource_id).ToImageSkia(); separator_ = - rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SEPARATOR).ToSkBitmap(); - shadow_ = rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SHADOW).ToSkBitmap(); + rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SEPARATOR).ToImageSkia(); + shadow_ = rb.GetImageNamed(IDR_AURA_WINDOW_FULLSCREEN_SHADOW).ToImageSkia(); AddChildView(close_button_); AddChildView(restore_button_); @@ -136,23 +136,23 @@ class AppNonClientFrameViewAura::ControlView private: // Sets images whose ids are passed in for each of the respective states // of |button|. - void SetButtonImages(views::ImageButton* button, int normal_bitmap_id, - int hot_bitmap_id, int pushed_bitmap_id) { + void SetButtonImages(views::ImageButton* button, int normal_image_id, + int hot_image_id, int pushed_image_id) { ui::ThemeProvider* theme_provider = GetThemeProvider(); button->SetImage(views::CustomButton::BS_NORMAL, - theme_provider->GetImageSkiaNamed(normal_bitmap_id)); + theme_provider->GetImageSkiaNamed(normal_image_id)); button->SetImage(views::CustomButton::BS_HOT, - theme_provider->GetImageSkiaNamed(hot_bitmap_id)); + theme_provider->GetImageSkiaNamed(hot_image_id)); button->SetImage(views::CustomButton::BS_PUSHED, - theme_provider->GetImageSkiaNamed(pushed_bitmap_id)); + theme_provider->GetImageSkiaNamed(pushed_image_id)); } AppNonClientFrameViewAura* owner_; views::ImageButton* close_button_; views::ImageButton* restore_button_; - const SkBitmap* control_base_; - const SkBitmap* separator_; - const SkBitmap* shadow_; + const gfx::ImageSkia* control_base_; + const gfx::ImageSkia* separator_; + const gfx::ImageSkia* shadow_; DISALLOW_COPY_AND_ASSIGN(ControlView); }; diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc index e117d1b..946d58e 100644 --- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc @@ -247,7 +247,7 @@ bool AppPanelBrowserFrameView::ShouldTabIconViewAnimate() const { return current_tab ? current_tab->IsLoading() : false; } -SkBitmap AppPanelBrowserFrameView::GetFaviconForTabIconView() { +gfx::ImageSkia AppPanelBrowserFrameView::GetFaviconForTabIconView() { return frame()->widget_delegate()->GetWindowIcon(); } @@ -311,26 +311,27 @@ gfx::Rect AppPanelBrowserFrameView::IconBounds() const { void AppPanelBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - SkBitmap* top_left_corner = rb.GetBitmapNamed(IDR_WINDOW_TOP_LEFT_CORNER); - SkBitmap* top_right_corner = - rb.GetBitmapNamed(IDR_WINDOW_TOP_RIGHT_CORNER); - SkBitmap* top_edge = rb.GetBitmapNamed(IDR_WINDOW_TOP_CENTER); - SkBitmap* right_edge = rb.GetBitmapNamed(IDR_WINDOW_RIGHT_SIDE); - SkBitmap* left_edge = rb.GetBitmapNamed(IDR_WINDOW_LEFT_SIDE); - SkBitmap* bottom_left_corner = - rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER); - SkBitmap* bottom_right_corner = - rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER); - SkBitmap* bottom_edge = rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_CENTER); + gfx::ImageSkia* top_left_corner = + rb.GetImageSkiaNamed(IDR_WINDOW_TOP_LEFT_CORNER); + gfx::ImageSkia* top_right_corner = + rb.GetImageSkiaNamed(IDR_WINDOW_TOP_RIGHT_CORNER); + gfx::ImageSkia* top_edge = rb.GetImageSkiaNamed(IDR_WINDOW_TOP_CENTER); + gfx::ImageSkia* right_edge = rb.GetImageSkiaNamed(IDR_WINDOW_RIGHT_SIDE); + gfx::ImageSkia* left_edge = rb.GetImageSkiaNamed(IDR_WINDOW_LEFT_SIDE); + gfx::ImageSkia* bottom_left_corner = + rb.GetImageSkiaNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER); + gfx::ImageSkia* bottom_right_corner = + rb.GetImageSkiaNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER); + gfx::ImageSkia* bottom_edge = rb.GetImageSkiaNamed(IDR_WINDOW_BOTTOM_CENTER); // Window frame mode and color. - SkBitmap* theme_frame; + gfx::ImageSkia* theme_frame; SkColor frame_color; if (ShouldPaintAsActive()) { - theme_frame = rb.GetBitmapNamed(IDR_FRAME_APP_PANEL); + theme_frame = rb.GetImageSkiaNamed(IDR_FRAME_APP_PANEL); frame_color = kFrameColorAppPanel; } else { - theme_frame = rb.GetBitmapNamed(IDR_FRAME_APP_PANEL); + theme_frame = rb.GetImageSkiaNamed(IDR_FRAME_APP_PANEL); frame_color = kFrameColorAppPanelInactive; } @@ -391,13 +392,13 @@ void AppPanelBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { void AppPanelBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - SkBitmap* frame_image = rb.GetBitmapNamed(IDR_FRAME_APP_PANEL); + gfx::ImageSkia* frame_image = rb.GetImageSkiaNamed(IDR_FRAME_APP_PANEL); canvas->TileImageInt(*frame_image, 0, FrameBorderThickness(), width(), frame_image->height()); // The bottom of the titlebar actually comes from the top of the Client Edge // graphic, with the actual client edge clipped off the bottom. - SkBitmap* titlebar_bottom = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); + gfx::ImageSkia* titlebar_bottom = rb.GetImageSkiaNamed(IDR_APP_TOP_CENTER); int edge_height = titlebar_bottom->height() - kClientEdgeThickness; canvas->TileImageInt(*titlebar_bottom, 0, frame()->client_view()->y() - edge_height, @@ -417,16 +418,16 @@ void AppPanelBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { int client_area_top = client_area_bounds.y(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - SkBitmap* top_left = rb.GetBitmapNamed(IDR_APP_TOP_LEFT); - SkBitmap* top = rb.GetBitmapNamed(IDR_APP_TOP_CENTER); - SkBitmap* top_right = rb.GetBitmapNamed(IDR_APP_TOP_RIGHT); - SkBitmap* right = rb.GetBitmapNamed(IDR_CONTENT_RIGHT_SIDE); - SkBitmap* bottom_right = - rb.GetBitmapNamed(IDR_CONTENT_BOTTOM_RIGHT_CORNER); - SkBitmap* bottom = rb.GetBitmapNamed(IDR_CONTENT_BOTTOM_CENTER); - SkBitmap* bottom_left = - rb.GetBitmapNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER); - SkBitmap* left = rb.GetBitmapNamed(IDR_CONTENT_LEFT_SIDE); + gfx::ImageSkia* top_left = rb.GetImageSkiaNamed(IDR_APP_TOP_LEFT); + gfx::ImageSkia* top = rb.GetImageSkiaNamed(IDR_APP_TOP_CENTER); + gfx::ImageSkia* top_right = rb.GetImageSkiaNamed(IDR_APP_TOP_RIGHT); + gfx::ImageSkia* right = rb.GetImageSkiaNamed(IDR_CONTENT_RIGHT_SIDE); + gfx::ImageSkia* bottom_right = + rb.GetImageSkiaNamed(IDR_CONTENT_BOTTOM_RIGHT_CORNER); + gfx::ImageSkia* bottom = rb.GetImageSkiaNamed(IDR_CONTENT_BOTTOM_CENTER); + gfx::ImageSkia* bottom_left = + rb.GetImageSkiaNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER); + gfx::ImageSkia* left = rb.GetImageSkiaNamed(IDR_CONTENT_LEFT_SIDE); // Top. int top_edge_y = client_area_top - top->height(); diff --git a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h index 8b049c3..0d35ef7 100644 --- a/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/app_panel_browser_frame_view.h @@ -54,7 +54,7 @@ class AppPanelBrowserFrameView : public BrowserNonClientFrameView, // Overridden from TabIconView::TabIconViewModel: virtual bool ShouldTabIconViewAnimate() const OVERRIDE; - virtual SkBitmap GetFaviconForTabIconView() OVERRIDE; + virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; private: // Returns the thickness of the border that makes up the window frame edges. diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index f813cc4..928f98f 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -252,11 +252,10 @@ class ResizeCorner : public views::View { if (!widget || (widget->IsMaximized() || widget->IsFullscreen())) return; - SkBitmap* bitmap = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( - IDR_TEXTAREA_RESIZER); - bitmap->buildMipMap(false); - canvas->DrawBitmapInt(*bitmap, width() - bitmap->width(), - height() - bitmap->height()); + gfx::ImageSkia* image = ui::ResourceBundle::GetSharedInstance(). + GetImageSkiaNamed(IDR_TEXTAREA_RESIZER); + canvas->DrawBitmapInt(*image, width() - image->width(), + height() - image->height()); } static gfx::Size GetSize() { @@ -513,10 +512,10 @@ TabContentsWrapper* BrowserView::GetSelectedTabContentsWrapper() const { return browser_->GetSelectedTabContentsWrapper(); } -SkBitmap BrowserView::GetOTRAvatarIcon() const { +gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - const SkBitmap* otr_avatar = - rb.GetNativeImageNamed(IDR_OTR_ICON).ToSkBitmap(); + const gfx::ImageSkia* otr_avatar = + rb.GetNativeImageNamed(IDR_OTR_ICON).ToImageSkia(); return *otr_avatar; } @@ -1429,7 +1428,7 @@ bool BrowserView::ShouldShowWindowTitle() const { return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); } -SkBitmap BrowserView::GetWindowAppIcon() { +gfx::ImageSkia BrowserView::GetWindowAppIcon() { if (browser_->is_app()) { TabContentsWrapper* contents = browser_->GetSelectedTabContentsWrapper(); if (contents && contents->extension_tab_helper()->GetExtensionAppIcon()) @@ -1439,10 +1438,10 @@ SkBitmap BrowserView::GetWindowAppIcon() { return GetWindowIcon(); } -SkBitmap BrowserView::GetWindowIcon() { +gfx::ImageSkia BrowserView::GetWindowIcon() { if (browser_->is_app()) return browser_->GetCurrentPageIcon(); - return SkBitmap(); + return gfx::ImageSkia(); } bool BrowserView::ShouldShowWindowIcon() const { diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 026dd3d..84ca459 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -181,7 +181,7 @@ class BrowserView : public BrowserWindow, TabContentsWrapper* GetSelectedTabContentsWrapper() const; // Retrieves the icon to use in the frame to indicate an OTR window. - SkBitmap GetOTRAvatarIcon() const; + gfx::ImageSkia GetOTRAvatarIcon() const; // Returns true if the Browser object associated with this BrowserView is a // tabbed-type window (i.e. a browser window, not an app or popup). @@ -352,8 +352,8 @@ class BrowserView : public BrowserWindow, virtual string16 GetAccessibleWindowTitle() const OVERRIDE; virtual views::View* GetInitiallyFocusedView() OVERRIDE; virtual bool ShouldShowWindowTitle() const OVERRIDE; - virtual SkBitmap GetWindowAppIcon() OVERRIDE; - virtual SkBitmap GetWindowIcon() OVERRIDE; + virtual gfx::ImageSkia GetWindowAppIcon() OVERRIDE; + virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; virtual bool ShouldShowWindowIcon() const OVERRIDE; virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; virtual std::string GetWindowName() const OVERRIDE; diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc index 01e32c1..7f90a74 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc @@ -280,9 +280,11 @@ void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { int w = toolbar_bounds.width(); int left_x = x - kContentEdgeShadowThickness; - SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); - SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER); - SkBitmap* toolbar_center = tp->GetBitmapNamed(IDR_CONTENT_TOP_CENTER); + gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); + gfx::ImageSkia* toolbar_left = tp->GetImageSkiaNamed( + IDR_CONTENT_TOP_LEFT_CORNER); + gfx::ImageSkia* toolbar_center = tp->GetImageSkiaNamed( + IDR_CONTENT_TOP_CENTER); // Tile the toolbar image starting at the frame edge on the left and where // the tabstrip is on the top. @@ -293,10 +295,10 @@ void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { dest_y, w, theme_toolbar->height()); // Draw rounded corners for the tab. - SkBitmap* toolbar_left_mask = - tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); - SkBitmap* toolbar_right_mask = - tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); + gfx::ImageSkia* toolbar_left_mask = + tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); + gfx::ImageSkia* toolbar_right_mask = + tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); // We mask out the corners by using the DestinationIn transfer mode, // which keeps the RGB pixels from the destination and the alpha from @@ -320,7 +322,7 @@ void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { right_x - (left_x + toolbar_left->width()), toolbar_center->height()); // Right edge. - canvas->DrawBitmapInt(*tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER), + canvas->DrawBitmapInt(*tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER), right_x, y); // Draw the content/toolbar separator. @@ -339,27 +341,27 @@ void GlassBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { // of how tall the toolbar itself is. int client_area_top = frame()->client_view()->y() + browser_view()->GetToolbarBounds().y() + - tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER)->height(); + tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER)->height(); int client_area_bottom = std::max(client_area_top, height() - NonClientBorderThickness()); int client_area_height = client_area_bottom - client_area_top; // Draw the client edge images. - SkBitmap* right = tp->GetBitmapNamed(IDR_CONTENT_RIGHT_SIDE); + gfx::ImageSkia* right = tp->GetImageSkiaNamed(IDR_CONTENT_RIGHT_SIDE); canvas->TileImageInt(*right, client_area_bounds.right(), client_area_top, right->width(), client_area_height); canvas->DrawBitmapInt( - *tp->GetBitmapNamed(IDR_CONTENT_BOTTOM_RIGHT_CORNER), + *tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_RIGHT_CORNER), client_area_bounds.right(), client_area_bottom); - SkBitmap* bottom = tp->GetBitmapNamed(IDR_CONTENT_BOTTOM_CENTER); + gfx::ImageSkia* bottom = tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_CENTER); canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, client_area_bounds.width(), bottom->height()); - SkBitmap* bottom_left = - tp->GetBitmapNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER); + gfx::ImageSkia* bottom_left = + tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER); canvas->DrawBitmapInt(*bottom_left, client_area_bounds.x() - bottom_left->width(), client_area_bottom); - SkBitmap* left = tp->GetBitmapNamed(IDR_CONTENT_LEFT_SIDE); + gfx::ImageSkia* left = tp->GetImageSkiaNamed(IDR_CONTENT_LEFT_SIDE); canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), client_area_top, left->width(), client_area_height); @@ -385,7 +387,7 @@ void GlassBrowserFrameView::LayoutAvatar() { // Even though the avatar is used for both incognito and profiles we always // use the incognito icon to layout the avatar button. The profile icon // can be customized so we can't depend on its size to perform layout. - SkBitmap incognito_icon = browser_view()->GetOTRAvatarIcon(); + gfx::ImageSkia incognito_icon = browser_view()->GetOTRAvatarIcon(); int avatar_x = NonClientBorderThickness() + kAvatarLeftSpacing; // Move this avatar icon by the size of window controls to prevent it from @@ -450,7 +452,7 @@ void GlassBrowserFrameView::StopThrobber() { // Check if hosted BrowserView has a window icon to use. if (browser_view()->ShouldShowWindowIcon()) { - SkBitmap icon = browser_view()->GetWindowIcon(); + gfx::ImageSkia icon = browser_view()->GetWindowIcon(); if (!icon.isNull()) frame_icon = IconUtil::CreateHICONFromSkBitmap(icon); } diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index db03849..942a23b 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc @@ -416,11 +416,11 @@ bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const { return current_tab ? current_tab->IsLoading() : false; } -SkBitmap OpaqueBrowserFrameView::GetFaviconForTabIconView() { +gfx::ImageSkia OpaqueBrowserFrameView::GetFaviconForTabIconView() { views::WidgetDelegate* delegate = frame()->widget_delegate(); if (!delegate) { LOG(WARNING) << "delegate is NULL, returning safe default."; - return SkBitmap(); + return gfx::ImageSkia(); } return delegate->GetWindowIcon(); } @@ -446,24 +446,24 @@ void OpaqueBrowserFrameView::Observe( // OpaqueBrowserFrameView, private: views::ImageButton* OpaqueBrowserFrameView::InitWindowCaptionButton( - int normal_bitmap_id, - int hot_bitmap_id, - int pushed_bitmap_id, - int mask_bitmap_id, + int normal_image_id, + int hot_image_id, + int pushed_image_id, + int mask_image_id, int accessibility_string_id) { views::ImageButton* button = new views::ImageButton(this); ui::ThemeProvider* tp = frame()->GetThemeProvider(); button->SetImage(views::CustomButton::BS_NORMAL, - tp->GetImageSkiaNamed(normal_bitmap_id)); + tp->GetImageSkiaNamed(normal_image_id)); button->SetImage(views::CustomButton::BS_HOT, - tp->GetImageSkiaNamed(hot_bitmap_id)); + tp->GetImageSkiaNamed(hot_image_id)); button->SetImage(views::CustomButton::BS_PUSHED, - tp->GetImageSkiaNamed(pushed_bitmap_id)); + tp->GetImageSkiaNamed(pushed_image_id)); if (browser_view()->IsBrowserTypeNormal()) { button->SetBackground( tp->GetColor(ThemeService::COLOR_BUTTON_BACKGROUND), tp->GetImageSkiaNamed(IDR_THEME_WINDOW_CONTROL_BACKGROUND), - tp->GetImageSkiaNamed(mask_bitmap_id)); + tp->GetImageSkiaNamed(mask_image_id)); } button->SetAccessibleName( l10n_util::GetStringUTF16(accessibility_string_id)); @@ -544,21 +544,21 @@ gfx::Rect OpaqueBrowserFrameView::IconBounds() const { void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { frame_background_->set_frame_color(GetFrameColor()); - frame_background_->set_theme_bitmap(GetFrameBitmap()); - frame_background_->set_theme_overlay_bitmap(GetFrameOverlayBitmap()); + frame_background_->set_theme_image(GetFrameImage()); + frame_background_->set_theme_overlay_image(GetFrameOverlayImage()); frame_background_->set_top_area_height(GetTopAreaHeight()); ui::ThemeProvider* tp = GetThemeProvider(); frame_background_->SetSideImages( - tp->GetBitmapNamed(IDR_WINDOW_LEFT_SIDE), - tp->GetBitmapNamed(IDR_WINDOW_TOP_CENTER), - tp->GetBitmapNamed(IDR_WINDOW_RIGHT_SIDE), - tp->GetBitmapNamed(IDR_WINDOW_BOTTOM_CENTER)); + tp->GetImageSkiaNamed(IDR_WINDOW_LEFT_SIDE), + tp->GetImageSkiaNamed(IDR_WINDOW_TOP_CENTER), + tp->GetImageSkiaNamed(IDR_WINDOW_RIGHT_SIDE), + tp->GetImageSkiaNamed(IDR_WINDOW_BOTTOM_CENTER)); frame_background_->SetCornerImages( - tp->GetBitmapNamed(IDR_WINDOW_TOP_LEFT_CORNER), - tp->GetBitmapNamed(IDR_WINDOW_TOP_RIGHT_CORNER), - tp->GetBitmapNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER), - tp->GetBitmapNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER)); + tp->GetImageSkiaNamed(IDR_WINDOW_TOP_LEFT_CORNER), + tp->GetImageSkiaNamed(IDR_WINDOW_TOP_RIGHT_CORNER), + tp->GetImageSkiaNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER), + tp->GetImageSkiaNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER)); frame_background_->PaintRestored(canvas, this); // Note: When we don't have a toolbar, we need to draw some kind of bottom @@ -569,8 +569,8 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { frame_background_->set_frame_color(GetFrameColor()); - frame_background_->set_theme_bitmap(GetFrameBitmap()); - frame_background_->set_theme_overlay_bitmap(GetFrameOverlayBitmap()); + frame_background_->set_theme_image(GetFrameImage()); + frame_background_->set_theme_overlay_image(GetFrameOverlayImage()); frame_background_->set_top_area_height(GetTopAreaHeight()); // Theme frame must be aligned with the tabstrip as if we were @@ -587,8 +587,8 @@ void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { // There's no toolbar to edge the frame border, so we need to draw a bottom // edge. The graphic we use for this has a built in client edge, so we clip // it off the bottom. - SkBitmap* top_center = - GetThemeProvider()->GetBitmapNamed(IDR_APP_TOP_CENTER); + gfx::ImageSkia* top_center = + GetThemeProvider()->GetImageSkiaNamed(IDR_APP_TOP_CENTER); int edge_height = top_center->height() - kClientEdgeThickness; canvas->TileImageInt(*top_center, 0, frame()->client_view()->y() - edge_height, width(), edge_height); @@ -636,7 +636,8 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { int split_point = kFrameShadowThickness * 2; int bottom_y = y + split_point; ui::ThemeProvider* tp = GetThemeProvider(); - SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER); + gfx::ImageSkia* toolbar_left = tp->GetImageSkiaNamed( + IDR_CONTENT_TOP_LEFT_CORNER); int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point; // Split our canvas out so we can mask out the corners of the toolbar @@ -651,16 +652,16 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { // Tile the toolbar image starting at the frame edge on the left and where the // horizontal tabstrip is (or would be) on the top. - SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR); + gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); canvas->TileImageInt(*theme_toolbar, x, bottom_y - GetHorizontalTabStripVerticalOffset(false), x, bottom_y, w, theme_toolbar->height()); // Draw rounded corners for the tab. - SkBitmap* toolbar_left_mask = - tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); - SkBitmap* toolbar_right_mask = - tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); + gfx::ImageSkia* toolbar_left_mask = + tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); + gfx::ImageSkia* toolbar_right_mask = + tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); // We mask out the corners by using the DestinationIn transfer mode, // which keeps the RGB pixels from the destination and the alpha from @@ -697,13 +698,14 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { bottom_edge_height, left_x, bottom_y, toolbar_left->width(), bottom_edge_height, false); - SkBitmap* toolbar_center = - tp->GetBitmapNamed(IDR_CONTENT_TOP_CENTER); + gfx::ImageSkia* toolbar_center = + tp->GetImageSkiaNamed(IDR_CONTENT_TOP_CENTER); canvas->TileImageInt(*toolbar_center, 0, 0, left_x + toolbar_left->width(), y, right_x - (left_x + toolbar_left->width()), split_point); - SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_CONTENT_TOP_RIGHT_CORNER); + gfx::ImageSkia* toolbar_right = tp->GetImageSkiaNamed( + IDR_CONTENT_TOP_RIGHT_CORNER); canvas->DrawBitmapInt(*toolbar_right, 0, 0, toolbar_right->width(), split_point, right_x, y, toolbar_right->width(), split_point, false); canvas->DrawBitmapInt(*toolbar_right, 0, @@ -733,15 +735,15 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { // whichever is shorter. gfx::Rect toolbar_bounds(browser_view()->GetToolbarBounds()); image_top += toolbar_bounds.y() + - tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER)->height(); + tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER)->height(); client_area_top = std::min(image_top, client_area_top + toolbar_bounds.bottom() - kClientEdgeThickness); } else if (!browser_view()->IsTabStripVisible()) { // The toolbar isn't going to draw a client edge for us, so draw one // ourselves. - SkBitmap* top_left = tp->GetBitmapNamed(IDR_APP_TOP_LEFT); - SkBitmap* top_center = tp->GetBitmapNamed(IDR_APP_TOP_CENTER); - SkBitmap* top_right = tp->GetBitmapNamed(IDR_APP_TOP_RIGHT); + gfx::ImageSkia* top_left = tp->GetImageSkiaNamed(IDR_APP_TOP_LEFT); + gfx::ImageSkia* top_center = tp->GetImageSkiaNamed(IDR_APP_TOP_CENTER); + gfx::ImageSkia* top_right = tp->GetImageSkiaNamed(IDR_APP_TOP_RIGHT); int top_edge_y = client_area_top - top_center->height(); int height = client_area_top - top_edge_y; @@ -767,21 +769,21 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { // Draw the client edge images. // Draw the client edge images. - SkBitmap* right = tp->GetBitmapNamed(IDR_CONTENT_RIGHT_SIDE); + gfx::ImageSkia* right = tp->GetImageSkiaNamed(IDR_CONTENT_RIGHT_SIDE); canvas->TileImageInt(*right, client_area_bounds.right(), image_top, right->width(), image_height); canvas->DrawBitmapInt( - *tp->GetBitmapNamed(IDR_CONTENT_BOTTOM_RIGHT_CORNER), + *tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_RIGHT_CORNER), client_area_bounds.right(), client_area_bottom); - SkBitmap* bottom = tp->GetBitmapNamed(IDR_CONTENT_BOTTOM_CENTER); + gfx::ImageSkia* bottom = tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_CENTER); canvas->TileImageInt(*bottom, client_area_bounds.x(), client_area_bottom, client_area_bounds.width(), bottom->height()); - SkBitmap* bottom_left = - tp->GetBitmapNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER); + gfx::ImageSkia* bottom_left = + tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER); canvas->DrawBitmapInt(*bottom_left, client_area_bounds.x() - bottom_left->width(), client_area_bottom); - SkBitmap* left = tp->GetBitmapNamed(IDR_CONTENT_LEFT_SIDE); + gfx::ImageSkia* left = tp->GetImageSkiaNamed(IDR_CONTENT_LEFT_SIDE); canvas->TileImageInt(*left, client_area_bounds.x() - left->width(), image_top, left->width(), image_height); @@ -823,7 +825,7 @@ SkColor OpaqueBrowserFrameView::GetFrameColor() const { ThemeService::COLOR_FRAME_INACTIVE); } -SkBitmap* OpaqueBrowserFrameView::GetFrameBitmap() const { +gfx::ImageSkia* OpaqueBrowserFrameView::GetFrameImage() const { bool is_incognito = browser_view()->IsOffTheRecord(); int resource_id; if (browser_view()->IsBrowserTypeNormal()) { @@ -834,7 +836,7 @@ SkBitmap* OpaqueBrowserFrameView::GetFrameBitmap() const { resource_id = is_incognito ? IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE; } - return GetThemeProvider()->GetBitmapNamed(resource_id); + return GetThemeProvider()->GetImageSkiaNamed(resource_id); } // Never theme app and popup windows. ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); @@ -845,23 +847,23 @@ SkBitmap* OpaqueBrowserFrameView::GetFrameBitmap() const { resource_id = is_incognito ? IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE; } - return rb.GetBitmapNamed(resource_id); + return rb.GetImageSkiaNamed(resource_id); } -SkBitmap* OpaqueBrowserFrameView::GetFrameOverlayBitmap() const { +gfx::ImageSkia* OpaqueBrowserFrameView::GetFrameOverlayImage() const { ui::ThemeProvider* tp = GetThemeProvider(); if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && browser_view()->IsBrowserTypeNormal() && !browser_view()->IsOffTheRecord()) { - return tp->GetBitmapNamed(ShouldPaintAsActive() ? + return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); } return NULL; } int OpaqueBrowserFrameView::GetTopAreaHeight() const { - SkBitmap* frame_bitmap = GetFrameBitmap(); - int top_area_height = frame_bitmap->height(); + gfx::ImageSkia* frame_image = GetFrameImage(); + int top_area_height = frame_image->height(); if (browser_view()->IsTabStripVisible()) { top_area_height = std::max(top_area_height, GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); @@ -941,7 +943,7 @@ void OpaqueBrowserFrameView::LayoutAvatar() { // Even though the avatar is used for both incognito and profiles we always // use the incognito icon to layout the avatar button. The profile icon // can be customized so we can't depend on its size to perform layout. - SkBitmap incognito_icon = browser_view()->GetOTRAvatarIcon(); + gfx::ImageSkia incognito_icon = browser_view()->GetOTRAvatarIcon(); int avatar_bottom = GetHorizontalTabStripVerticalOffset(false) + browser_view()->GetTabStripHeight() - kAvatarBottomSpacing; diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h index 61ca17c..8b53a05 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h @@ -74,7 +74,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, // Overridden from TabIconView::TabIconViewModel: virtual bool ShouldTabIconViewAnimate() const OVERRIDE; - virtual SkBitmap GetFaviconForTabIconView() OVERRIDE; + virtual gfx::ImageSkia GetFaviconForTabIconView() OVERRIDE; // content::NotificationObserver implementation: virtual void Observe(int type, @@ -84,10 +84,10 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, private: // Creates, adds and returns a new image button with |this| as its listener. // Memory is owned by the caller. - views::ImageButton* InitWindowCaptionButton(int normal_bitmap_id, - int hot_bitmap_id, - int pushed_bitmap_id, - int mask_bitmap_id, + views::ImageButton* InitWindowCaptionButton(int normal_image_id, + int hot_image_id, + int pushed_image_id, + int mask_image_id, int accessibility_string_id); // Returns the thickness of the border that makes up the window frame edges. @@ -131,8 +131,8 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, // Compute aspects of the frame needed to paint the frame background. SkColor GetFrameColor() const; - SkBitmap* GetFrameBitmap() const; - SkBitmap* GetFrameOverlayBitmap() const; + gfx::ImageSkia* GetFrameImage() const; + gfx::ImageSkia* GetFrameOverlayImage() const; int GetTopAreaHeight() const; // Layout various sub-components of this view. diff --git a/chrome/browser/ui/views/tab_icon_view.h b/chrome/browser/ui/views/tab_icon_view.h index 2786599..ffbc8c5 100644 --- a/chrome/browser/ui/views/tab_icon_view.h +++ b/chrome/browser/ui/views/tab_icon_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,9 @@ #include "base/compiler_specific.h" #include "ui/views/view.h" -class SkBitmap; +namespace gfx { +class ImageSkia; +} //////////////////////////////////////////////////////////////////////////////// // @@ -25,7 +27,7 @@ class TabIconView : public views::View { virtual bool ShouldTabIconViewAnimate() const = 0; // Returns the favicon to display in the icon view - virtual SkBitmap GetFaviconForTabIconView() = 0; + virtual gfx::ImageSkia GetFaviconForTabIconView() = 0; }; static void InitializeIfNeeded(); diff --git a/content/browser/web_contents/web_contents_drag_win.cc b/content/browser/web_contents/web_contents_drag_win.cc index 4dbac90..d154f5f 100644 --- a/content/browser/web_contents/web_contents_drag_win.cc +++ b/content/browser/web_contents/web_contents_drag_win.cc @@ -28,6 +28,7 @@ #include "ui/base/clipboard/clipboard_util_win.h" #include "ui/base/clipboard/custom_data_helper.h" #include "ui/base/dragdrop/drag_utils.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/size.h" #include "webkit/glue/webdropdata.h" @@ -297,8 +298,8 @@ void WebContentsDragWin::DoDragging(const WebDropData& drop_data, // Set drag image. if (!image.isNull()) { - drag_utils::SetDragImageOnDataObject( - image, gfx::Size(image.width(), image.height()), image_offset, &data); + drag_utils::SetDragImageOnDataObject(gfx::ImageSkia(image), + gfx::Size(image.width(), image.height()), image_offset, &data); } // We need to enable recursive tasks on the message loop so we can get diff --git a/ui/base/dragdrop/drag_utils.cc b/ui/base/dragdrop/drag_utils.cc index 5336cb0..9e1bad51 100644 --- a/ui/base/dragdrop/drag_utils.cc +++ b/ui/base/dragdrop/drag_utils.cc @@ -25,7 +25,7 @@ static const int kFileDragImageMaxWidth = 200; static const SkColor kFileDragImageTextColor = SK_ColorBLACK; void CreateDragImageForFile(const FilePath& file_name, - const SkBitmap* icon, + const gfx::ImageSkia* icon, ui::OSExchangeData* data_object) { DCHECK(icon); DCHECK(data_object); diff --git a/ui/base/dragdrop/drag_utils.h b/ui/base/dragdrop/drag_utils.h index b81511d..7c8e443 100644 --- a/ui/base/dragdrop/drag_utils.h +++ b/ui/base/dragdrop/drag_utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,10 +12,10 @@ #include "ui/base/ui_export.h" class GURL; -class SkBitmap; namespace gfx { class Canvas; +class ImageSkia; class Point; class Size; } @@ -32,7 +32,7 @@ namespace drag_utils { // the supplied data_object. 'file_name' can be a full path, but the directory // portion will be truncated in the drag image. UI_EXPORT void CreateDragImageForFile(const FilePath& file_name, - const SkBitmap* icon, + const gfx::ImageSkia* icon, ui::OSExchangeData* data_object); // Sets the drag image on data_object from the supplied canvas. width/height @@ -43,10 +43,10 @@ UI_EXPORT void SetDragImageOnDataObject(const gfx::Canvas& canvas, const gfx::Point& cursor_offset, ui::OSExchangeData* data_object); -// Sets the drag image on data_object from the supplied bitmap. width/height +// Sets the drag image on data_object from the supplied ImageSkia. width/height // are the size of the image to use, and the offsets give the location of // the hotspot for the drag image. -UI_EXPORT void SetDragImageOnDataObject(const SkBitmap& bitmap, +UI_EXPORT void SetDragImageOnDataObject(const gfx::ImageSkia& image_skia, const gfx::Size& size, const gfx::Point& cursor_offset, ui::OSExchangeData* data_object); diff --git a/ui/base/dragdrop/drag_utils_aura.cc b/ui/base/dragdrop/drag_utils_aura.cc index 54a78c6..63a22aa 100644 --- a/ui/base/dragdrop/drag_utils_aura.cc +++ b/ui/base/dragdrop/drag_utils_aura.cc @@ -5,22 +5,22 @@ #include "ui/base/dragdrop/drag_utils.h" #include "base/logging.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/point.h" #include "ui/gfx/size.h" namespace drag_utils { -void SetDragImageOnDataObject(const SkBitmap& bitmap, +void SetDragImageOnDataObject(const gfx::ImageSkia& image, const gfx::Size& size, const gfx::Point& cursor_offset, ui::OSExchangeData* data_object) { ui::OSExchangeDataProviderAura& provider( static_cast<ui::OSExchangeDataProviderAura&>(data_object->provider())); - provider.set_drag_image(bitmap); + provider.set_drag_image(image); provider.set_drag_image_offset(cursor_offset); } diff --git a/ui/base/dragdrop/drag_utils_gtk.cc b/ui/base/dragdrop/drag_utils_gtk.cc index 1cc1773..e97ba9e 100644 --- a/ui/base/dragdrop/drag_utils_gtk.cc +++ b/ui/base/dragdrop/drag_utils_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,25 +7,25 @@ #include <gtk/gtk.h> #include "base/logging.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/dragdrop/os_exchange_data_provider_gtk.h" #include "ui/gfx/canvas.h" #include "ui/gfx/gtk_util.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/point.h" #include "ui/gfx/size.h" namespace drag_utils { -void SetDragImageOnDataObject(const SkBitmap& bitmap, +void SetDragImageOnDataObject(const gfx::ImageSkia& image_skia, const gfx::Size& size, const gfx::Point& cursor_offset, ui::OSExchangeData* data_object) { ui::OSExchangeDataProviderGtk& provider( static_cast<ui::OSExchangeDataProviderGtk&>(data_object->provider())); - // Convert the bitmap into a GdkPixbuf. - GdkPixbuf* canvas_pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap); + // Convert the image into a GdkPixbuf. + GdkPixbuf* canvas_pixbuf = gfx::GdkPixbufFromSkBitmap(image_skia.bitmap()); // Make a new pixbuf of the requested size and copy it over. GdkPixbuf* pixbuf = gdk_pixbuf_new( diff --git a/ui/base/dragdrop/drag_utils_win.cc b/ui/base/dragdrop/drag_utils_win.cc index f3ef3bf..f7d05ee 100644 --- a/ui/base/dragdrop/drag_utils_win.cc +++ b/ui/base/dragdrop/drag_utils_win.cc @@ -14,6 +14,7 @@ #include "ui/base/dragdrop/os_exchange_data_provider_win.h" #include "ui/gfx/canvas.h" #include "ui/gfx/gdi_util.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/skbitmap_operations.h" namespace drag_utils { @@ -53,7 +54,7 @@ static HBITMAP CreateHBITMAPFromSkBitmap(const SkBitmap& sk_bitmap) { return bitmap; } -void SetDragImageOnDataObject(const SkBitmap& sk_bitmap, +void SetDragImageOnDataObject(const gfx::ImageSkia& image_skia, const gfx::Size& size, const gfx::Point& cursor_offset, ui::OSExchangeData* data_object) { @@ -62,7 +63,7 @@ void SetDragImageOnDataObject(const SkBitmap& sk_bitmap, // by premultiplied colors, so unpremultiply the bitmap. // SetDragImageOnDataObject(HBITMAP) takes ownership of the bitmap. HBITMAP bitmap = CreateHBITMAPFromSkBitmap( - SkBitmapOperations::UnPreMultiply(sk_bitmap)); + SkBitmapOperations::UnPreMultiply(*image_skia.bitmap())); // Attach 'bitmap' to the data_object. SetDragImageOnDataObject(bitmap, size, cursor_offset, diff --git a/ui/base/dragdrop/os_exchange_data_provider_aura.h b/ui/base/dragdrop/os_exchange_data_provider_aura.h index 0758a7a..6137062 100644 --- a/ui/base/dragdrop/os_exchange_data_provider_aura.h +++ b/ui/base/dragdrop/os_exchange_data_provider_aura.h @@ -8,11 +8,11 @@ #include <map> -#include "base/pickle.h" #include "base/file_path.h" +#include "base/pickle.h" #include "googleurl/src/gurl.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/dragdrop/os_exchange_data.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/point.h" namespace ui { @@ -59,8 +59,11 @@ class UI_EXPORT OSExchangeDataProviderAura : public OSExchangeData::Provider { virtual bool GetHtml(string16* html, GURL* base_url) const OVERRIDE; virtual bool HasHtml() const OVERRIDE; - void set_drag_image(const SkBitmap& drag_image) { drag_image_ = drag_image; } - const SkBitmap& drag_image() const { return drag_image_; } + void set_drag_image(const gfx::ImageSkia& drag_image) { + drag_image_ = drag_image; + } + + const gfx::ImageSkia& drag_image() const { return drag_image_; } void set_drag_image_offset(const gfx::Point& drag_image_offset) { drag_image_offset_ = drag_image_offset; } @@ -91,7 +94,7 @@ class UI_EXPORT OSExchangeDataProviderAura : public OSExchangeData::Provider { PickleData pickle_data_; // Drag image and offset data. - SkBitmap drag_image_; + gfx::ImageSkia drag_image_; gfx::Point drag_image_offset_; // For HTML format diff --git a/ui/base/native_theme/native_theme_android.cc b/ui/base/native_theme/native_theme_android.cc index 89f5bae..7025e8f 100644 --- a/ui/base/native_theme/native_theme_android.cc +++ b/ui/base/native_theme/native_theme_android.cc @@ -279,19 +279,19 @@ void NativeThemeAndroid::PaintCheckbox(SkCanvas* canvas, const gfx::Rect& rect, const ButtonExtraParams& button) const { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - SkBitmap* image = NULL; + gfx::ImageSkia* image = NULL; if (button.indeterminate) { image = state == kDisabled ? - rb.GetBitmapNamed(IDR_CHECKBOX_DISABLED_INDETERMINATE) : - rb.GetBitmapNamed(IDR_CHECKBOX_INDETERMINATE); + rb.GetImageSkiaNamed(IDR_CHECKBOX_DISABLED_INDETERMINATE) : + rb.GetImageSkiaNamed(IDR_CHECKBOX_INDETERMINATE); } else if (button.checked) { image = state == kDisabled ? - rb.GetBitmapNamed(IDR_CHECKBOX_DISABLED_ON) : - rb.GetBitmapNamed(IDR_CHECKBOX_ON); + rb.GetImageSkiaNamed(IDR_CHECKBOX_DISABLED_ON) : + rb.GetImageSkiaNamed(IDR_CHECKBOX_ON); } else { image = state == kDisabled ? - rb.GetBitmapNamed(IDR_CHECKBOX_DISABLED_OFF) : - rb.GetBitmapNamed(IDR_CHECKBOX_OFF); + rb.GetImageSkiaNamed(IDR_CHECKBOX_DISABLED_OFF) : + rb.GetImageSkiaNamed(IDR_CHECKBOX_OFF); } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); @@ -304,15 +304,15 @@ void NativeThemeAndroid::PaintRadio(SkCanvas* canvas, const gfx::Rect& rect, const ButtonExtraParams& button) const { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - SkBitmap* image = NULL; + gfx::ImageSkia* image = NULL; if (state == kDisabled) { image = button.checked ? - rb.GetBitmapNamed(IDR_RADIO_DISABLED_ON) : - rb.GetBitmapNamed(IDR_RADIO_DISABLED_OFF); + rb.GetImageSkiaNamed(IDR_RADIO_DISABLED_ON) : + rb.GetImageSkiaNamed(IDR_RADIO_DISABLED_OFF); } else { image = button.checked ? - rb.GetBitmapNamed(IDR_RADIO_ON) : - rb.GetBitmapNamed(IDR_RADIO_OFF); + rb.GetImageSkiaNamed(IDR_RADIO_ON) : + rb.GetImageSkiaNamed(IDR_RADIO_OFF); } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); @@ -599,9 +599,11 @@ void NativeThemeAndroid::PaintProgressBar( const gfx::Rect& rect, const ProgressBarExtraParams& progress_bar) const { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - SkBitmap* bar_image = rb.GetBitmapNamed(IDR_PROGRESS_BAR); - SkBitmap* left_border_image = rb.GetBitmapNamed(IDR_PROGRESS_BORDER_LEFT); - SkBitmap* right_border_image = rb.GetBitmapNamed(IDR_PROGRESS_BORDER_RIGHT); + gfx::ImageSkia* bar_image = rb.GetImageSkiaNamed(IDR_PROGRESS_BAR); + gfx::ImageSkia* left_border_image = rb.GetImageSkiaNamed( + IDR_PROGRESS_BORDER_LEFT); + gfx::ImageSkia* right_border_image = rb.GetImageSkiaNamed( + IDR_PROGRESS_BORDER_RIGHT); float tile_scale = static_cast<float>(rect.height()) / bar_image->height(); @@ -614,7 +616,7 @@ void NativeThemeAndroid::PaintProgressBar( rect.x(), rect.y(), rect.width(), rect.height()); if (progress_bar.value_rect_width) { - SkBitmap* value_image = rb.GetBitmapNamed(IDR_PROGRESS_VALUE); + gfx::ImageSkia* value_image = rb.GetImageSkiaNamed(IDR_PROGRESS_VALUE); new_tile_width = static_cast<int>(value_image->width() * tile_scale); tile_scale_x = static_cast<float>(new_tile_width) / @@ -629,16 +631,16 @@ void NativeThemeAndroid::PaintProgressBar( int dest_left_border_width = static_cast<int>(left_border_image->width() * tile_scale); - SkRect dest_rect; - dest_rect.iset(rect.x(), rect.y(), rect.x() + dest_left_border_width, - rect.bottom()); - canvas->drawBitmapRect(*left_border_image, NULL, dest_rect); + DrawBitmapInt(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); - dest_rect.iset(rect.right() - dest_right_border_width, rect.y(), rect.right(), - rect.bottom()); - canvas->drawBitmapRect(*right_border_image, NULL, dest_rect); + 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()); } bool NativeThemeAndroid::IntersectsClipRectInt(SkCanvas* canvas, @@ -653,7 +655,7 @@ bool NativeThemeAndroid::IntersectsClipRectInt(SkCanvas* canvas, } void NativeThemeAndroid::DrawBitmapInt(SkCanvas* canvas, - const SkBitmap& bitmap, + const gfx::ImageSkia& image, int src_x, int src_y, int src_w, @@ -662,12 +664,12 @@ void NativeThemeAndroid::DrawBitmapInt(SkCanvas* canvas, int dest_y, int dest_w, int dest_h) const { - gfx::Canvas(canvas).DrawBitmapInt(bitmap, src_x, src_y, src_w, src_h, + gfx::Canvas(canvas).DrawBitmapInt(image, src_x, src_y, src_w, src_h, dest_x, dest_y, dest_w, dest_h, true); } void NativeThemeAndroid::DrawTiledImage(SkCanvas* canvas, - const SkBitmap& bitmap, + const gfx::ImageSkia& image, int src_x, int src_y, float tile_scale_x, @@ -676,7 +678,7 @@ void NativeThemeAndroid::DrawTiledImage(SkCanvas* canvas, int dest_y, int w, int h) const { - gfx::Canvas(canvas).TileImageInt(bitmap, src_x, src_y, tile_scale_x, + gfx::Canvas(canvas).TileImageInt(image, src_x, src_y, tile_scale_x, tile_scale_y, dest_x, dest_y, w, h); } diff --git a/ui/base/native_theme/native_theme_android.h b/ui/base/native_theme/native_theme_android.h index eba1f5f..04c7be3 100644 --- a/ui/base/native_theme/native_theme_android.h +++ b/ui/base/native_theme/native_theme_android.h @@ -12,6 +12,7 @@ #include "ui/base/native_theme/native_theme.h" namespace gfx { +class ImageSkia; class Rect; class Size; } @@ -112,10 +113,10 @@ class NativeThemeAndroid : public NativeTheme { int w, int h) const; - // Draw the dest rectangle with the given bitmap which might be scaled if its + // 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 SkBitmap& bitmap, + const gfx::ImageSkia& image, int src_x, int src_y, int src_w, @@ -128,7 +129,7 @@ class NativeThemeAndroid : public NativeTheme { // Draw the target rectangle with the |bitmap| accroding the given // |tile_scale_x| and |tile_scale_y| void DrawTiledImage(SkCanvas* canvas, - const SkBitmap& bitmap, + const gfx::ImageSkia& image, int src_x, int src_y, float tile_scale_x, diff --git a/ui/base/native_theme/native_theme_aura.cc b/ui/base/native_theme/native_theme_aura.cc index 613eb96..c31e2ec 100644 --- a/ui/base/native_theme/native_theme_aura.cc +++ b/ui/base/native_theme/native_theme_aura.cc @@ -8,6 +8,7 @@ #include "grit/ui_resources_standard.h" #include "ui/base/layout.h" #include "ui/base/resource/resource_bundle.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" #include "ui/gfx/skbitmap_operations.h" @@ -158,7 +159,8 @@ void NativeThemeAura::PaintScrollbarTrack( // after updating WebKit so we can draw the entire track in one go instead // of as two separate pieces: otherwise, only the portion of the scrollbar // that the mouse is over gets the highlighted state. - SkBitmap* top = rb.GetBitmapNamed(IDR_SCROLL_BASE_VERTICAL_TOP_H); + gfx::ImageSkia* top = rb.GetImageSkiaNamed( + IDR_SCROLL_BASE_VERTICAL_TOP_H); DrawTiledImage(canvas, *top, 0, 0, 1.0, 1.0, rect.x(), rect.y(), top->width(), top->height()); @@ -168,7 +170,8 @@ void NativeThemeAura::PaintScrollbarTrack( if (rect.y() + rect.height() == extra_params.track_y + extra_params.track_height) { - SkBitmap* bottom = rb.GetBitmapNamed(IDR_SCROLL_BASE_VERTICAL_BOTTOM_H); + gfx::ImageSkia* bottom = rb.GetImageSkiaNamed( + IDR_SCROLL_BASE_VERTICAL_BOTTOM_H); DrawTiledImage(canvas, *bottom, 0, 0, 1.0, 1.0, rect.x(), rect.y() + rect.height() - bottom->height(), @@ -177,7 +180,8 @@ void NativeThemeAura::PaintScrollbarTrack( } if (center_height > 0) { - SkBitmap* center = rb.GetBitmapNamed(IDR_SCROLL_BASE_VERTICAL_CENTER_H); + gfx::ImageSkia* center = rb.GetImageSkiaNamed( + IDR_SCROLL_BASE_VERTICAL_CENTER_H); DrawTiledImage(canvas, *center, 0, 0, 1.0, 1.0, rect.x(), rect.y() + center_offset, @@ -188,7 +192,8 @@ void NativeThemeAura::PaintScrollbarTrack( int center_width = rect.width(); if (rect.x() == extra_params.track_x) { - SkBitmap* left = rb.GetBitmapNamed(IDR_SCROLL_BASE_HORIZONTAL_LEFT_H); + gfx::ImageSkia* left = rb.GetImageSkiaNamed( + IDR_SCROLL_BASE_HORIZONTAL_LEFT_H); DrawTiledImage(canvas, *left, 0, 0, 1.0, 1.0, rect.x(), rect.y(), left->width(), left->height()); @@ -198,7 +203,8 @@ void NativeThemeAura::PaintScrollbarTrack( if (rect.x() + rect.width() == extra_params.track_x + extra_params.track_width) { - SkBitmap* right = rb.GetBitmapNamed(IDR_SCROLL_BASE_HORIZONTAL_RIGHT_H); + gfx::ImageSkia* right = rb.GetImageSkiaNamed( + IDR_SCROLL_BASE_HORIZONTAL_RIGHT_H); DrawTiledImage(canvas, *right, 0, 0, 1.0, 1.0, rect.x() + rect.width() - right->width(), rect.y(), @@ -207,7 +213,8 @@ void NativeThemeAura::PaintScrollbarTrack( } if (center_width > 0) { - SkBitmap* center = rb.GetBitmapNamed(IDR_SCROLL_BASE_HORIZONTAL_CENTER_H); + gfx::ImageSkia* center = rb.GetImageSkiaNamed( + IDR_SCROLL_BASE_HORIZONTAL_CENTER_H); DrawTiledImage(canvas, *center, 0, 0, 1.0, 1.0, rect.x() + center_offset, rect.y(), @@ -233,7 +240,7 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas, state == kHovered ? IDR_SCROLL_THUMB_VERTICAL_TOP_H : state == kPressed ? IDR_SCROLL_THUMB_VERTICAL_TOP_P : IDR_SCROLL_THUMB_VERTICAL_TOP; - SkBitmap* top = rb.GetBitmapNamed(top_resource_id); + gfx::ImageSkia* top = rb.GetImageSkiaNamed(top_resource_id); DrawTiledImage(canvas, *top, 0, 0, 1.0, 1.0, rect.x(), rect.y(), top->width(), top->height()); @@ -242,7 +249,7 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas, state == kHovered ? IDR_SCROLL_THUMB_VERTICAL_BOTTOM_H : state == kPressed ? IDR_SCROLL_THUMB_VERTICAL_BOTTOM_P : IDR_SCROLL_THUMB_VERTICAL_BOTTOM; - SkBitmap* bottom = rb.GetBitmapNamed(bottom_resource_id); + gfx::ImageSkia* bottom = rb.GetImageSkiaNamed(bottom_resource_id); DrawTiledImage(canvas, *bottom, 0, 0, 1.0, 1.0, rect.x(), rect.y() + rect.height() - bottom->height(), @@ -253,7 +260,7 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas, state == kHovered ? IDR_SCROLL_THUMB_VERTICAL_CENTER_H : state == kPressed ? IDR_SCROLL_THUMB_VERTICAL_CENTER_P : IDR_SCROLL_THUMB_VERTICAL_CENTER; - SkBitmap* center = rb.GetBitmapNamed(center_resource_id); + gfx::ImageSkia* center = rb.GetImageSkiaNamed(center_resource_id); DrawTiledImage(canvas, *center, 0, 0, 1.0, 1.0, rect.x(), rect.y() + top->height(), @@ -265,7 +272,7 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas, state == kHovered ? IDR_SCROLL_THUMB_HORIZONTAL_LEFT_H : state == kPressed ? IDR_SCROLL_THUMB_HORIZONTAL_LEFT_P : IDR_SCROLL_THUMB_HORIZONTAL_LEFT; - SkBitmap* left = rb.GetBitmapNamed(left_resource_id); + gfx::ImageSkia* left = rb.GetImageSkiaNamed(left_resource_id); DrawTiledImage(canvas, *left, 0, 0, 1.0, 1.0, rect.x(), rect.y(), left->width(), left->height()); @@ -274,7 +281,7 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas, state == kHovered ? IDR_SCROLL_THUMB_HORIZONTAL_RIGHT_H : state == kPressed ? IDR_SCROLL_THUMB_HORIZONTAL_RIGHT_P : IDR_SCROLL_THUMB_HORIZONTAL_RIGHT; - SkBitmap* right = rb.GetBitmapNamed(right_resource_id); + gfx::ImageSkia* right = rb.GetImageSkiaNamed(right_resource_id); DrawTiledImage(canvas, *right, 0, 0, 1.0, 1.0, rect.x() + rect.width() - right->width(), rect.y(), @@ -285,7 +292,7 @@ void NativeThemeAura::PaintScrollbarThumb(SkCanvas* canvas, state == kHovered ? IDR_SCROLL_THUMB_HORIZONTAL_CENTER_H : state == kPressed ? IDR_SCROLL_THUMB_HORIZONTAL_CENTER_P : IDR_SCROLL_THUMB_HORIZONTAL_CENTER; - SkBitmap* center = rb.GetBitmapNamed(center_resource_id); + gfx::ImageSkia* center = rb.GetImageSkiaNamed(center_resource_id); DrawTiledImage(canvas, *center, 0, 0, 1.0, 1.0, rect.x() + left->width(), rect.y(), diff --git a/ui/base/native_theme/native_theme_base.cc b/ui/base/native_theme/native_theme_base.cc index d8d3d6f..a44c59e0a 100644 --- a/ui/base/native_theme/native_theme_base.cc +++ b/ui/base/native_theme/native_theme_base.cc @@ -12,6 +12,7 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" @@ -444,19 +445,19 @@ void NativeThemeBase::PaintCheckbox(SkCanvas* canvas, const gfx::Rect& rect, const ButtonExtraParams& button) const { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - SkBitmap* image = NULL; + gfx::ImageSkia* image = NULL; if (button.indeterminate) { image = state == kDisabled ? - rb.GetBitmapNamed(IDR_CHECKBOX_DISABLED_INDETERMINATE) : - rb.GetBitmapNamed(IDR_CHECKBOX_INDETERMINATE); + rb.GetImageSkiaNamed(IDR_CHECKBOX_DISABLED_INDETERMINATE) : + rb.GetImageSkiaNamed(IDR_CHECKBOX_INDETERMINATE); } else if (button.checked) { image = state == kDisabled ? - rb.GetBitmapNamed(IDR_CHECKBOX_DISABLED_ON) : - rb.GetBitmapNamed(IDR_CHECKBOX_ON); + rb.GetImageSkiaNamed(IDR_CHECKBOX_DISABLED_ON) : + rb.GetImageSkiaNamed(IDR_CHECKBOX_ON); } else { image = state == kDisabled ? - rb.GetBitmapNamed(IDR_CHECKBOX_DISABLED_OFF) : - rb.GetBitmapNamed(IDR_CHECKBOX_OFF); + rb.GetImageSkiaNamed(IDR_CHECKBOX_DISABLED_OFF) : + rb.GetImageSkiaNamed(IDR_CHECKBOX_OFF); } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); @@ -469,15 +470,15 @@ void NativeThemeBase::PaintRadio(SkCanvas* canvas, const gfx::Rect& rect, const ButtonExtraParams& button) const { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - SkBitmap* image = NULL; + gfx::ImageSkia* image = NULL; if (state == kDisabled) { image = button.checked ? - rb.GetBitmapNamed(IDR_RADIO_DISABLED_ON) : - rb.GetBitmapNamed(IDR_RADIO_DISABLED_OFF); + rb.GetImageSkiaNamed(IDR_RADIO_DISABLED_ON) : + rb.GetImageSkiaNamed(IDR_RADIO_DISABLED_OFF); } else { image = button.checked ? - rb.GetBitmapNamed(IDR_RADIO_ON) : - rb.GetBitmapNamed(IDR_RADIO_OFF); + rb.GetImageSkiaNamed(IDR_RADIO_ON) : + rb.GetImageSkiaNamed(IDR_RADIO_OFF); } gfx::Rect bounds = rect.Center(gfx::Size(image->width(), image->height())); @@ -759,9 +760,11 @@ void NativeThemeBase::PaintProgressBar(SkCanvas* canvas, const gfx::Rect& rect, const ProgressBarExtraParams& progress_bar) const { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - SkBitmap* bar_image = rb.GetBitmapNamed(IDR_PROGRESS_BAR); - SkBitmap* left_border_image = rb.GetBitmapNamed(IDR_PROGRESS_BORDER_LEFT); - SkBitmap* right_border_image = rb.GetBitmapNamed(IDR_PROGRESS_BORDER_RIGHT); + gfx::ImageSkia* bar_image = rb.GetImageSkiaNamed(IDR_PROGRESS_BAR); + gfx::ImageSkia* left_border_image = rb.GetImageSkiaNamed( + IDR_PROGRESS_BORDER_LEFT); + gfx::ImageSkia* right_border_image = rb.GetImageSkiaNamed( + IDR_PROGRESS_BORDER_RIGHT); float tile_scale = static_cast<float>(rect.height()) / bar_image->height(); @@ -774,7 +777,7 @@ void NativeThemeBase::PaintProgressBar(SkCanvas* canvas, rect.x(), rect.y(), rect.width(), rect.height()); if (progress_bar.value_rect_width) { - SkBitmap* value_image = rb.GetBitmapNamed(IDR_PROGRESS_VALUE); + gfx::ImageSkia* value_image = rb.GetImageSkiaNamed(IDR_PROGRESS_VALUE); new_tile_width = static_cast<int>(value_image->width() * tile_scale); tile_scale_x = static_cast<float>(new_tile_width) / @@ -789,16 +792,16 @@ void NativeThemeBase::PaintProgressBar(SkCanvas* canvas, int dest_left_border_width = static_cast<int>(left_border_image->width() * tile_scale); - SkRect dest_rect; - dest_rect.iset(rect.x(), rect.y(), rect.x() + dest_left_border_width, - rect.bottom()); - canvas->drawBitmapRect(*left_border_image, NULL, dest_rect); + DrawBitmapInt(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); - dest_rect.iset(rect.right() - dest_right_border_width, rect.y(), rect.right(), - rect.bottom()); - canvas->drawBitmapRect(*right_border_image, NULL, dest_rect); + 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()); } bool NativeThemeBase::IntersectsClipRectInt(SkCanvas* canvas, @@ -810,18 +813,18 @@ bool NativeThemeBase::IntersectsClipRectInt(SkCanvas* canvas, } void NativeThemeBase::DrawBitmapInt( - SkCanvas* canvas, const SkBitmap& bitmap, + 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(bitmap, src_x, src_y, src_w, src_h, + gfx::Canvas(canvas).DrawBitmapInt(image, src_x, src_y, src_w, src_h, dest_x, dest_y, dest_w, dest_h, true); } void NativeThemeBase::DrawTiledImage(SkCanvas* canvas, - const SkBitmap& bitmap, + const gfx::ImageSkia& image, int src_x, int src_y, float tile_scale_x, float tile_scale_y, int dest_x, int dest_y, int w, int h) const { - gfx::Canvas(canvas).TileImageInt(bitmap, src_x, src_y, tile_scale_x, + gfx::Canvas(canvas).TileImageInt(image, src_x, src_y, tile_scale_x, tile_scale_y, dest_x, dest_y, w, h); } diff --git a/ui/base/native_theme/native_theme_base.h b/ui/base/native_theme/native_theme_base.h index a3372d3..5e6096e 100644 --- a/ui/base/native_theme/native_theme_base.h +++ b/ui/base/native_theme/native_theme_base.h @@ -12,6 +12,7 @@ #include "ui/base/native_theme/native_theme.h" namespace gfx { +class ImageSkia; class Rect; class Size; } @@ -127,12 +128,12 @@ class NativeThemeBase : public NativeTheme { bool IntersectsClipRectInt(SkCanvas* canvas, int x, int y, int w, int h) const; - void DrawBitmapInt(SkCanvas* canvas, const SkBitmap& bitmap, + 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 DrawTiledImage(SkCanvas* canvas, - const SkBitmap& bitmap, + const gfx::ImageSkia& image, int src_x, int src_y, float tile_scale_x, float tile_scale_y, int dest_x, int dest_y, int w, int h) const; diff --git a/ui/oak/oak_window.cc b/ui/oak/oak_window.cc index 5266336..7bcf202 100644 --- a/ui/oak/oak_window.cc +++ b/ui/oak/oak_window.cc @@ -4,13 +4,13 @@ #include "ui/oak/oak_window.h" -#include "ui/oak/oak.h" #include "base/utf_string_conversions.h" #include "grit/ui_resources.h" #include "ui/aura/root_window.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image.h" +#include "ui/oak/oak.h" #include "ui/oak/oak_aura_window_display.h" #include "ui/views/controls/table/table_view.h" #include "ui/views/controls/tree/tree_view.h" @@ -57,9 +57,9 @@ views::View* OakWindow::GetContentsView() { return this; } -SkBitmap OakWindow::GetWindowIcon() { +gfx::ImageSkia OakWindow::GetWindowIcon() { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - return *rb.GetImageNamed(IDR_OAK).ToSkBitmap(); + return *rb.GetImageNamed(IDR_OAK).ToImageSkia(); } bool OakWindow::ShouldShowWindowIcon() const { diff --git a/ui/oak/oak_window.h b/ui/oak/oak_window.h index dfa2799..b198042 100644 --- a/ui/oak/oak_window.h +++ b/ui/oak/oak_window.h @@ -33,7 +33,7 @@ class OakWindow : public views::WidgetDelegateView, virtual bool CanMaximize() const OVERRIDE; virtual string16 GetWindowTitle() const OVERRIDE; virtual views::View* GetContentsView() OVERRIDE; - virtual SkBitmap GetWindowIcon() OVERRIDE; + virtual gfx::ImageSkia GetWindowIcon() OVERRIDE; virtual bool ShouldShowWindowIcon() const OVERRIDE; virtual void DeleteDelegate() OVERRIDE; diff --git a/ui/views/bubble/bubble_border.cc b/ui/views/bubble/bubble_border.cc index 143f3c4..6f550d5 100644 --- a/ui/views/bubble/bubble_border.cc +++ b/ui/views/bubble/bubble_border.cc @@ -9,9 +9,9 @@ #include "base/logging.h" #include "grit/ui_resources.h" #include "grit/ui_resources_standard.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/skia_util.h" namespace views { @@ -33,18 +33,18 @@ struct BubbleBorder::BorderImages { border_thickness(0) { } - SkBitmap* left; - SkBitmap* top_left; - SkBitmap* top; - SkBitmap* top_right; - SkBitmap* right; - SkBitmap* bottom_right; - SkBitmap* bottom; - SkBitmap* bottom_left; - SkBitmap* left_arrow; - SkBitmap* top_arrow; - SkBitmap* right_arrow; - SkBitmap* bottom_arrow; + gfx::ImageSkia* left; + gfx::ImageSkia* top_left; + gfx::ImageSkia* top; + gfx::ImageSkia* top_right; + gfx::ImageSkia* right; + gfx::ImageSkia* bottom_right; + gfx::ImageSkia* bottom; + gfx::ImageSkia* bottom_left; + gfx::ImageSkia* left_arrow; + gfx::ImageSkia* top_arrow; + gfx::ImageSkia* right_arrow; + gfx::ImageSkia* bottom_arrow; int border_thickness; }; @@ -91,7 +91,7 @@ gfx::Rect BubbleBorder::GetBounds(const gfx::Rect& position_relative_to, // Screen position depends on the arrow location. // The arrow should overlap the target by some amount since there is space - // for shadow between arrow tip and bitmap bounds. + // for shadow between arrow tip and image bounds. const int kArrowOverlap = 3; int x = position_relative_to.x(); int y = position_relative_to.y(); @@ -224,34 +224,34 @@ BubbleBorder::BorderImages* BubbleBorder::GetBorderImages(Shadow shadow) { if (shadow == SHADOW && shadow_images_ == NULL) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); shadow_images_ = new BorderImages(); - shadow_images_->left = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_L); - shadow_images_->top_left = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_TL); - shadow_images_->top = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_T); - shadow_images_->top_right = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_TR); - shadow_images_->right = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_R); - shadow_images_->bottom_right = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_BR); - shadow_images_->bottom = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_B); - shadow_images_->bottom_left = rb.GetBitmapNamed(IDR_BUBBLE_SHADOW_BL); - shadow_images_->left_arrow = new SkBitmap(); - shadow_images_->top_arrow = new SkBitmap(); - shadow_images_->right_arrow = new SkBitmap(); - shadow_images_->bottom_arrow = new SkBitmap(); + shadow_images_->left = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_L); + shadow_images_->top_left = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_TL); + shadow_images_->top = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_T); + shadow_images_->top_right = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_TR); + shadow_images_->right = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_R); + shadow_images_->bottom_right = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_BR); + shadow_images_->bottom = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_B); + shadow_images_->bottom_left = rb.GetImageSkiaNamed(IDR_BUBBLE_SHADOW_BL); + shadow_images_->left_arrow = new gfx::ImageSkia(); + shadow_images_->top_arrow = new gfx::ImageSkia(); + shadow_images_->right_arrow = new gfx::ImageSkia(); + shadow_images_->bottom_arrow = new gfx::ImageSkia(); shadow_images_->border_thickness = 10; } else if (shadow == NO_SHADOW && normal_images_ == NULL) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); normal_images_ = new BorderImages(); - normal_images_->left = rb.GetBitmapNamed(IDR_BUBBLE_L); - normal_images_->top_left = rb.GetBitmapNamed(IDR_BUBBLE_TL); - normal_images_->top = rb.GetBitmapNamed(IDR_BUBBLE_T); - normal_images_->top_right = rb.GetBitmapNamed(IDR_BUBBLE_TR); - normal_images_->right = rb.GetBitmapNamed(IDR_BUBBLE_R); - normal_images_->bottom_right = rb.GetBitmapNamed(IDR_BUBBLE_BR); - normal_images_->bottom = rb.GetBitmapNamed(IDR_BUBBLE_B); - normal_images_->bottom_left = rb.GetBitmapNamed(IDR_BUBBLE_BL); - normal_images_->left_arrow = rb.GetBitmapNamed(IDR_BUBBLE_L_ARROW); - normal_images_->top_arrow = rb.GetBitmapNamed(IDR_BUBBLE_T_ARROW); - normal_images_->right_arrow = rb.GetBitmapNamed(IDR_BUBBLE_R_ARROW); - normal_images_->bottom_arrow = rb.GetBitmapNamed(IDR_BUBBLE_B_ARROW); + normal_images_->left = rb.GetImageSkiaNamed(IDR_BUBBLE_L); + normal_images_->top_left = rb.GetImageSkiaNamed(IDR_BUBBLE_TL); + normal_images_->top = rb.GetImageSkiaNamed(IDR_BUBBLE_T); + normal_images_->top_right = rb.GetImageSkiaNamed(IDR_BUBBLE_TR); + normal_images_->right = rb.GetImageSkiaNamed(IDR_BUBBLE_R); + normal_images_->bottom_right = rb.GetImageSkiaNamed(IDR_BUBBLE_BR); + normal_images_->bottom = rb.GetImageSkiaNamed(IDR_BUBBLE_B); + normal_images_->bottom_left = rb.GetImageSkiaNamed(IDR_BUBBLE_BL); + normal_images_->left_arrow = rb.GetImageSkiaNamed(IDR_BUBBLE_L_ARROW); + normal_images_->top_arrow = rb.GetImageSkiaNamed(IDR_BUBBLE_T_ARROW); + normal_images_->right_arrow = rb.GetImageSkiaNamed(IDR_BUBBLE_R_ARROW); + normal_images_->bottom_arrow = rb.GetImageSkiaNamed(IDR_BUBBLE_B_ARROW); normal_images_->border_thickness = 0; } return shadow == SHADOW ? shadow_images_ : normal_images_; @@ -422,8 +422,8 @@ void BubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) const { void BubbleBorder::DrawEdgeWithArrow(gfx::Canvas* canvas, bool is_horizontal, - SkBitmap* edge, - SkBitmap* arrow, + gfx::ImageSkia* edge, + gfx::ImageSkia* arrow, int start_x, int start_y, int before_arrow, diff --git a/ui/views/bubble/bubble_border.h b/ui/views/bubble/bubble_border.h index 71df7da..61bf81d 100644 --- a/ui/views/bubble/bubble_border.h +++ b/ui/views/bubble/bubble_border.h @@ -10,7 +10,9 @@ #include "ui/views/background.h" #include "ui/views/border.h" -class SkBitmap; +namespace gfx { +class ImageSkia; +} namespace views { @@ -133,8 +135,8 @@ class VIEWS_EXPORT BubbleBorder : public views::Border { void DrawEdgeWithArrow(gfx::Canvas* canvas, bool is_horizontal, - SkBitmap* edge, - SkBitmap* arrow, + gfx::ImageSkia* edge, + gfx::ImageSkia* arrow, int start_x, int start_y, int before_arrow, diff --git a/ui/views/button_drag_utils.cc b/ui/views/button_drag_utils.cc index d65bc29..da52b9c 100644 --- a/ui/views/button_drag_utils.cc +++ b/ui/views/button_drag_utils.cc @@ -21,7 +21,7 @@ static const int kLinkDragImageMaxWidth = 200; void SetURLAndDragImage(const GURL& url, const string16& title, - const SkBitmap& icon, + const gfx::ImageSkia& icon, ui::OSExchangeData* data) { DCHECK(url.is_valid() && data); @@ -33,7 +33,7 @@ void SetURLAndDragImage(const GURL& url, button.set_max_width(kLinkDragImageMaxWidth); if (icon.isNull()) { button.SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageNamed( - IDR_DEFAULT_FAVICON).ToSkBitmap()); + IDR_DEFAULT_FAVICON).ToImageSkia()); } else { button.SetIcon(icon); } diff --git a/ui/views/button_drag_utils.h b/ui/views/button_drag_utils.h index de9b79a..d9d3bbc 100644 --- a/ui/views/button_drag_utils.h +++ b/ui/views/button_drag_utils.h @@ -10,7 +10,10 @@ #include "ui/views/views_export.h" class GURL; -class SkBitmap; + +namespace gfx { +class ImageSkia; +} namespace ui { class OSExchangeData; @@ -22,7 +25,7 @@ namespace button_drag_utils { // The image looks like that of the bookmark buttons. VIEWS_EXPORT void SetURLAndDragImage(const GURL& url, const string16& title, - const SkBitmap& icon, + const gfx::ImageSkia& icon, ui::OSExchangeData* data); } // namespace drag_utils diff --git a/ui/views/painter.cc b/ui/views/painter.cc index 5df86e7..e790888 100644 --- a/ui/views/painter.cc +++ b/ui/views/painter.cc @@ -5,11 +5,11 @@ #include "ui/views/painter.h" #include "base/logging.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/effects/SkGradientShader.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/image/image.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/insets.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" @@ -61,7 +61,7 @@ class GradientPainter : public Painter { class ImagePainter : public Painter { public: - ImagePainter(const SkBitmap& image, + ImagePainter(const gfx::ImageSkia& image, const gfx::Insets& insets, bool paint_center) : image_(image), @@ -141,7 +141,7 @@ class ImagePainter : public Painter { } private: - const SkBitmap image_; + const gfx::ImageSkia image_; const gfx::Insets insets_; bool paint_center_; @@ -172,7 +172,7 @@ Painter* Painter::CreateVerticalGradient(SkColor c1, SkColor c2) { } // static -Painter* Painter::CreateImagePainter(const SkBitmap& image, +Painter* Painter::CreateImagePainter(const gfx::ImageSkia& image, const gfx::Insets& insets, bool paint_center) { return new ImagePainter(image, insets, paint_center); @@ -181,7 +181,7 @@ Painter* Painter::CreateImagePainter(const SkBitmap& image, HorizontalPainter::HorizontalPainter(const int image_resource_names[]) { ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); for (int i = 0; i < 3; ++i) - images_[i] = rb.GetImageNamed(image_resource_names[i]).ToSkBitmap(); + images_[i] = rb.GetImageNamed(image_resource_names[i]).ToImageSkia(); height_ = images_[LEFT]->height(); DCHECK(images_[LEFT]->height() == images_[RIGHT]->height() && images_[LEFT]->height() == images_[CENTER]->height()); diff --git a/ui/views/painter.h b/ui/views/painter.h index 48a0a8e..85f7214 100644 --- a/ui/views/painter.h +++ b/ui/views/painter.h @@ -11,10 +11,9 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/views/views_export.h" -class SkBitmap; - namespace gfx { class Canvas; +class ImageSkia; class Insets; class Rect; class Size; @@ -43,7 +42,7 @@ class VIEWS_EXPORT Painter { // insets.left()xinsets.right()). The four edges are stretched to fill the // destination size. // Ownership is passed to the caller. - static Painter* CreateImagePainter(const SkBitmap& image, + static Painter* CreateImagePainter(const gfx::ImageSkia& image, const gfx::Insets& insets, bool paint_center); @@ -82,7 +81,7 @@ class VIEWS_EXPORT HorizontalPainter : public Painter { // The height. int height_; // NOTE: the images are owned by ResourceBundle. Don't free them. - const SkBitmap* images_[3]; + const gfx::ImageSkia* images_[3]; DISALLOW_COPY_AND_ASSIGN(HorizontalPainter); }; diff --git a/ui/views/view.h b/ui/views/view.h index dca93be..3f59881 100644 --- a/ui/views/view.h +++ b/ui/views/view.h @@ -485,7 +485,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, // if the UI layout is right-to-left; that is, the canvas will be flipped // only if base::i18n::IsRTL() returns true. // - // Enabling canvas flipping is useful for leaf views that draw a bitmap that + // Enabling canvas flipping is useful for leaf views that draw an image that // needs to be flipped horizontally when the UI layout is right-to-left // (views::Button, for example). This method is helpful for such classes // because their drawing logic stays the same and they can become agnostic to diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc index 90b17b9..a2e3a47 100644 --- a/ui/views/widget/native_widget_aura.cc +++ b/ui/views/widget/native_widget_aura.cc @@ -404,8 +404,8 @@ void NativeWidgetAura::SetWindowTitle(const string16& title) { window_->set_title(title); } -void NativeWidgetAura::SetWindowIcons(const SkBitmap& window_icon, - const SkBitmap& app_icon) { +void NativeWidgetAura::SetWindowIcons(const gfx::ImageSkia& window_icon, + const gfx::ImageSkia& app_icon) { // Aura doesn't have window icons. } diff --git a/ui/views/widget/native_widget_aura.h b/ui/views/widget/native_widget_aura.h index 7d89a77..8b4c7c5 100644 --- a/ui/views/widget/native_widget_aura.h +++ b/ui/views/widget/native_widget_aura.h @@ -74,8 +74,8 @@ class VIEWS_EXPORT NativeWidgetAura : public internal::NativeWidgetPrivate, gfx::Rect* bounds, ui::WindowShowState* maximized) const OVERRIDE; virtual void SetWindowTitle(const string16& title) OVERRIDE; - virtual void SetWindowIcons(const SkBitmap& window_icon, - const SkBitmap& app_icon) OVERRIDE; + virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, + const gfx::ImageSkia& app_icon) OVERRIDE; virtual void SetAccessibleName(const string16& name) OVERRIDE; virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE; virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE; diff --git a/ui/views/widget/native_widget_private.h b/ui/views/widget/native_widget_private.h index a56e5a6d..7eb8606 100644 --- a/ui/views/widget/native_widget_private.h +++ b/ui/views/widget/native_widget_private.h @@ -13,6 +13,7 @@ #include "ui/views/widget/native_widget.h" namespace gfx { +class ImageSkia; class Rect; } @@ -150,8 +151,8 @@ class VIEWS_EXPORT NativeWidgetPrivate : public NativeWidget, // Sets the Window icons. |window_icon| is a 16x16 icon suitable for use in // a title bar. |app_icon| is a larger size for use in the host environment // app switching UI. - virtual void SetWindowIcons(const SkBitmap& window_icon, - const SkBitmap& app_icon) = 0; + virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, + const gfx::ImageSkia& app_icon) = 0; // Update native accessibility properties on the native window. virtual void SetAccessibleName(const string16& name) = 0; diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc index 4ae16e2..ac23483 100644 --- a/ui/views/widget/native_widget_win.cc +++ b/ui/views/widget/native_widget_win.cc @@ -719,8 +719,8 @@ void NativeWidgetWin::SetWindowTitle(const string16& title) { SetAccessibleName(title); } -void NativeWidgetWin::SetWindowIcons(const SkBitmap& window_icon, - const SkBitmap& app_icon) { +void NativeWidgetWin::SetWindowIcons(const gfx::ImageSkia& window_icon, + const gfx::ImageSkia& app_icon) { if (!window_icon.isNull()) { HICON windows_icon = IconUtil::CreateHICONFromSkBitmap(window_icon); // We need to make sure to destroy the previous icon, otherwise we'll leak diff --git a/ui/views/widget/native_widget_win.h b/ui/views/widget/native_widget_win.h index 61019a9..d584390 100644 --- a/ui/views/widget/native_widget_win.h +++ b/ui/views/widget/native_widget_win.h @@ -204,8 +204,8 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl, gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; virtual void SetWindowTitle(const string16& title) OVERRIDE; - virtual void SetWindowIcons(const SkBitmap& window_icon, - const SkBitmap& app_icon) OVERRIDE; + virtual void SetWindowIcons(const gfx::ImageSkia& window_icon, + const gfx::ImageSkia& app_icon) OVERRIDE; virtual void SetAccessibleName(const string16& name) OVERRIDE; virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE; virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE; diff --git a/ui/views/widget/widget_delegate.cc b/ui/views/widget/widget_delegate.cc index baaf65b..c985780 100644 --- a/ui/views/widget/widget_delegate.cc +++ b/ui/views/widget/widget_delegate.cc @@ -5,7 +5,7 @@ #include "ui/views/widget/widget_delegate.h" #include "base/utf_string_conversions.h" -#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/gfx/image/image_skia.h" #include "ui/views/bubble/bubble_delegate.h" #include "ui/views/view.h" #include "ui/views/views_delegate.h" @@ -77,14 +77,14 @@ bool WidgetDelegate::ShouldShowWindowTitle() const { return true; } -SkBitmap WidgetDelegate::GetWindowAppIcon() { +gfx::ImageSkia WidgetDelegate::GetWindowAppIcon() { // Use the window icon as app icon by default. return GetWindowIcon(); } // Returns the icon to be displayed in the window. -SkBitmap WidgetDelegate::GetWindowIcon() { - return SkBitmap(); +gfx::ImageSkia WidgetDelegate::GetWindowIcon() { + return gfx::ImageSkia(); } bool WidgetDelegate::ShouldShowWindowIcon() const { diff --git a/ui/views/widget/widget_delegate.h b/ui/views/widget/widget_delegate.h index 0f9440a..3239c1d 100644 --- a/ui/views/widget/widget_delegate.h +++ b/ui/views/widget/widget_delegate.h @@ -12,9 +12,8 @@ #include "ui/base/ui_base_types.h" #include "ui/views/view.h" -class SkBitmap; - namespace gfx { +class ImageSkia; class Rect; } @@ -80,10 +79,10 @@ class VIEWS_EXPORT WidgetDelegate { // Returns the app icon for the window. On Windows, this is the ICON_BIG used // in Alt-Tab list and Win7's taskbar. - virtual SkBitmap GetWindowAppIcon(); + virtual gfx::ImageSkia GetWindowAppIcon(); // Returns the icon to be displayed in the window. - virtual SkBitmap GetWindowIcon(); + virtual gfx::ImageSkia GetWindowIcon(); // Returns true if a window icon should be shown. virtual bool ShouldShowWindowIcon() const; diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc index f4dd9dd..44cf9c7 100644 --- a/ui/views/window/custom_frame_view.cc +++ b/ui/views/window/custom_frame_view.cc @@ -318,29 +318,29 @@ bool CustomFrameView::ShouldShowClientEdge() const { void CustomFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { frame_background_->set_frame_color(GetFrameColor()); - const SkBitmap* frame_image = GetFrameBitmap(); - frame_background_->set_theme_bitmap(frame_image); + const gfx::ImageSkia* frame_image = GetFrameImage(); + frame_background_->set_theme_image(frame_image); frame_background_->set_top_area_height(frame_image->height()); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); frame_background_->SetCornerImages( - rb.GetImageNamed(IDR_WINDOW_TOP_LEFT_CORNER).ToSkBitmap(), - rb.GetImageNamed(IDR_WINDOW_TOP_RIGHT_CORNER).ToSkBitmap(), - rb.GetImageNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER).ToSkBitmap(), - rb.GetImageNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER).ToSkBitmap()); + rb.GetImageNamed(IDR_WINDOW_TOP_LEFT_CORNER).ToImageSkia(), + rb.GetImageNamed(IDR_WINDOW_TOP_RIGHT_CORNER).ToImageSkia(), + rb.GetImageNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER).ToImageSkia(), + rb.GetImageNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER).ToImageSkia()); frame_background_->SetSideImages( - rb.GetImageNamed(IDR_WINDOW_LEFT_SIDE).ToSkBitmap(), - rb.GetImageNamed(IDR_WINDOW_TOP_CENTER).ToSkBitmap(), - rb.GetImageNamed(IDR_WINDOW_RIGHT_SIDE).ToSkBitmap(), - rb.GetImageNamed(IDR_WINDOW_BOTTOM_CENTER).ToSkBitmap()); + rb.GetImageNamed(IDR_WINDOW_LEFT_SIDE).ToImageSkia(), + rb.GetImageNamed(IDR_WINDOW_TOP_CENTER).ToImageSkia(), + rb.GetImageNamed(IDR_WINDOW_RIGHT_SIDE).ToImageSkia(), + rb.GetImageNamed(IDR_WINDOW_BOTTOM_CENTER).ToImageSkia()); frame_background_->PaintRestored(canvas, this); } void CustomFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { - const SkBitmap* frame_image = GetFrameBitmap(); - frame_background_->set_theme_bitmap(frame_image); + const gfx::ImageSkia* frame_image = GetFrameImage(); + frame_background_->set_theme_image(frame_image); frame_background_->set_top_area_height(frame_image->height()); frame_background_->PaintMaximized(canvas, this); @@ -349,8 +349,8 @@ void CustomFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { // TODO(jamescook): Migrate this into FrameBackground. // The bottom of the titlebar actually comes from the top of the Client Edge // graphic, with the actual client edge clipped off the bottom. - const SkBitmap* titlebar_bottom = rb.GetImageNamed( - IDR_APP_TOP_CENTER).ToSkBitmap(); + const gfx::ImageSkia* titlebar_bottom = rb.GetImageNamed( + IDR_APP_TOP_CENTER).ToImageSkia(); int edge_height = titlebar_bottom->height() - (ShouldShowClientEdge() ? kClientEdgeThickness : 0); canvas->TileImageInt(*titlebar_bottom, 0, @@ -377,17 +377,22 @@ void CustomFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { int client_area_top = client_area_bounds.y(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - const SkBitmap* top_left = rb.GetImageNamed(IDR_APP_TOP_LEFT).ToSkBitmap(); - const SkBitmap* top = rb.GetImageNamed(IDR_APP_TOP_CENTER).ToSkBitmap(); - const SkBitmap* top_right = rb.GetImageNamed(IDR_APP_TOP_RIGHT).ToSkBitmap(); - const SkBitmap* right = rb.GetImageNamed(IDR_CONTENT_RIGHT_SIDE).ToSkBitmap(); - const SkBitmap* bottom_right = rb.GetImageNamed( - IDR_CONTENT_BOTTOM_RIGHT_CORNER).ToSkBitmap(); - const SkBitmap* bottom = rb.GetImageNamed( - IDR_CONTENT_BOTTOM_CENTER).ToSkBitmap(); - const SkBitmap* bottom_left = rb.GetImageNamed( - IDR_CONTENT_BOTTOM_LEFT_CORNER).ToSkBitmap(); - const SkBitmap* left = rb.GetImageNamed(IDR_CONTENT_LEFT_SIDE).ToSkBitmap(); + const gfx::ImageSkia* top_left = rb.GetImageNamed( + IDR_APP_TOP_LEFT).ToImageSkia(); + const gfx::ImageSkia* top = rb.GetImageNamed( + IDR_APP_TOP_CENTER).ToImageSkia(); + const gfx::ImageSkia* top_right = rb.GetImageNamed( + IDR_APP_TOP_RIGHT).ToImageSkia(); + const gfx::ImageSkia* right = rb.GetImageNamed( + IDR_CONTENT_RIGHT_SIDE).ToImageSkia(); + const gfx::ImageSkia* bottom_right = rb.GetImageNamed( + IDR_CONTENT_BOTTOM_RIGHT_CORNER).ToImageSkia(); + const gfx::ImageSkia* bottom = rb.GetImageNamed( + IDR_CONTENT_BOTTOM_CENTER).ToImageSkia(); + const gfx::ImageSkia* bottom_left = rb.GetImageNamed( + IDR_CONTENT_BOTTOM_LEFT_CORNER).ToImageSkia(); + const gfx::ImageSkia* left = rb.GetImageNamed( + IDR_CONTENT_LEFT_SIDE).ToImageSkia(); // Top. int top_edge_y = client_area_top - top->height(); @@ -426,9 +431,9 @@ SkColor CustomFrameView::GetFrameColor() const { return frame_->IsActive() ? kDefaultColorFrame : kDefaultColorFrameInactive; } -const SkBitmap* CustomFrameView::GetFrameBitmap() const { +const gfx::ImageSkia* CustomFrameView::GetFrameImage() const { return ui::ResourceBundle::GetSharedInstance().GetImageNamed( - frame_->IsActive() ? IDR_FRAME : IDR_FRAME_INACTIVE).ToSkBitmap(); + frame_->IsActive() ? IDR_FRAME : IDR_FRAME_INACTIVE).ToImageSkia(); } void CustomFrameView::LayoutWindowControls() { @@ -456,7 +461,7 @@ void CustomFrameView::LayoutWindowControls() { ImageButton* visible_button = is_restored ? maximize_button_ : restore_button_; - FramePartBitmap normal_part, hot_part, pushed_part; + FramePartImage normal_part, hot_part, pushed_part; if (should_show_minmax_buttons_) { visible_button->SetVisible(true); visible_button->SetImageAlignment(ImageButton::ALIGN_LEFT, diff --git a/ui/views/window/custom_frame_view.h b/ui/views/window/custom_frame_view.h index ca71063..50b6e86 100644 --- a/ui/views/window/custom_frame_view.h +++ b/ui/views/window/custom_frame_view.h @@ -12,7 +12,9 @@ #include "ui/views/controls/button/button.h" #include "ui/views/window/non_client_view.h" -class SkBitmap; +namespace gfx { +class ImageSkia; +} namespace views { @@ -94,7 +96,7 @@ class CustomFrameView : public NonClientFrameView, // Compute aspects of the frame needed to paint the frame background. SkColor GetFrameColor() const; - const SkBitmap* GetFrameBitmap() const; + const gfx::ImageSkia* GetFrameImage() const; // Layout various sub-components of this view. void LayoutWindowControls(); diff --git a/ui/views/window/frame_background.cc b/ui/views/window/frame_background.cc index 90a55f1..59e205f 100644 --- a/ui/views/window/frame_background.cc +++ b/ui/views/window/frame_background.cc @@ -15,8 +15,8 @@ namespace views { FrameBackground::FrameBackground() : frame_color_(0), - theme_bitmap_(NULL), - theme_overlay_bitmap_(NULL), + theme_image_(NULL), + theme_overlay_image_(NULL), top_area_height_(0), left_edge_(NULL), top_edge_(NULL), @@ -35,20 +35,20 @@ FrameBackground::FrameBackground() FrameBackground::~FrameBackground() { } -void FrameBackground::SetSideImages(const SkBitmap* left, - const SkBitmap* top, - const SkBitmap* right, - const SkBitmap* bottom) { +void FrameBackground::SetSideImages(const gfx::ImageSkia* left, + const gfx::ImageSkia* top, + const gfx::ImageSkia* right, + const gfx::ImageSkia* bottom) { left_edge_ = left; top_edge_ = top; right_edge_ = right; bottom_edge_ = bottom; } -void FrameBackground::SetCornerImages(const SkBitmap* top_left, - const SkBitmap* top_right, - const SkBitmap* bottom_left, - const SkBitmap* bottom_right) { +void FrameBackground::SetCornerImages(const gfx::ImageSkia* top_left, + const gfx::ImageSkia* top_right, + const gfx::ImageSkia* bottom_left, + const gfx::ImageSkia* bottom_right) { top_left_corner_ = top_left; top_right_corner_ = top_right; bottom_left_corner_ = bottom_left; @@ -61,12 +61,12 @@ void FrameBackground::PaintRestored(gfx::Canvas* canvas, View* view) const { PaintFrameColor(canvas, view); // Draw the theme frame. - canvas->TileImageInt(*theme_bitmap_, - 0, 0, view->width(), theme_bitmap_->height()); + canvas->TileImageInt(*theme_image_, + 0, 0, view->width(), theme_image_->height()); // Draw the theme frame overlay, if available. - if (theme_overlay_bitmap_) - canvas->DrawBitmapInt(*theme_overlay_bitmap_, 0, 0); + if (theme_overlay_image_) + canvas->DrawBitmapInt(*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. @@ -129,7 +129,7 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas, View* view) const { // to fill in the area beneath the image. // TODO(jamescook): I'm not sure this is correct, as it doesn't seem to fully // account for the top_offset, but this is how it worked before. - int theme_frame_bottom = maximized_top_offset_ + theme_bitmap_->height(); + int theme_frame_bottom = maximized_top_offset_ + theme_image_->height(); if (top_area_height_ > theme_frame_bottom) { canvas->FillRect(gfx::Rect(0, 0, view->width(), top_area_height_), frame_color_); @@ -151,14 +151,14 @@ void FrameBackground::PaintMaximized(gfx::Canvas* canvas, View* view) const { } // Draw the theme frame. - canvas->TileImageInt(*theme_bitmap_, + canvas->TileImageInt(*theme_image_, left_offset, maximized_top_offset_, view->width() - (left_offset + right_offset), - theme_bitmap_->height()); + theme_image_->height()); // Draw the theme frame overlay, if available. - if (theme_overlay_bitmap_) - canvas->DrawBitmapInt(*theme_overlay_bitmap_, 0, theme_background_y_); + if (theme_overlay_image_) + canvas->DrawBitmapInt(*theme_overlay_image_, 0, theme_background_y_); } void FrameBackground::PaintFrameColor(gfx::Canvas* canvas, View* view) const { diff --git a/ui/views/window/frame_background.h b/ui/views/window/frame_background.h index e68ff27..4b0d390 100644 --- a/ui/views/window/frame_background.h +++ b/ui/views/window/frame_background.h @@ -10,9 +10,9 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/views/views_export.h" -class SkBitmap; namespace gfx { class Canvas; +class ImageSkia; } namespace views { @@ -27,18 +27,18 @@ class VIEWS_EXPORT FrameBackground { FrameBackground(); ~FrameBackground(); - // Sets the color to draw under the frame bitmaps. + // Sets the color to draw under the frame images. void set_frame_color(SkColor color) { frame_color_ = color; } - // Sets the theme bitmap for the top of the window. May be NULL. + // Sets the theme image for the top of the window. May be NULL. // Memory is owned by the caller. - void set_theme_bitmap(const SkBitmap* bitmap) { theme_bitmap_ = bitmap; } + void set_theme_image(const gfx::ImageSkia* image) { theme_image_ = image; } - // Sets an image that overlays the top window bitmap. Usually used to add + // Sets an image that overlays the top window image. Usually used to add // edge highlighting to provide the illusion of depth. May be NULL. // Memory is owned by the caller. - void set_theme_overlay_bitmap(SkBitmap* bitmap) { - theme_overlay_bitmap_ = bitmap; + void set_theme_overlay_image(gfx::ImageSkia* image) { + theme_overlay_image_ = image; } // Sets the height of the top area to fill with the default frame color, @@ -53,17 +53,17 @@ class VIEWS_EXPORT FrameBackground { // Sets images used when drawing the sides of the frame. // Caller owns the memory. - void SetSideImages(const SkBitmap* left, - const SkBitmap* top, - const SkBitmap* right, - const SkBitmap* bottom); + void SetSideImages(const gfx::ImageSkia* left, + const gfx::ImageSkia* top, + const gfx::ImageSkia* right, + const gfx::ImageSkia* bottom); // Sets images used when drawing the corners of the frame. // Caller owns the memory. - void SetCornerImages(const SkBitmap* top_left, - const SkBitmap* top_right, - const SkBitmap* bottom_left, - const SkBitmap* bottom_right); + void SetCornerImages(const gfx::ImageSkia* top_left, + const gfx::ImageSkia* top_right, + const gfx::ImageSkia* bottom_left, + const gfx::ImageSkia* bottom_right); // Paints the border for a standard, non-maximized window. Also paints the // background of the title bar area, since the top frame border and the @@ -79,26 +79,26 @@ class VIEWS_EXPORT FrameBackground { void PaintFrameColor(gfx::Canvas* canvas, View* view) const; SkColor frame_color_; - const SkBitmap* theme_bitmap_; - SkBitmap* theme_overlay_bitmap_; + const gfx::ImageSkia* theme_image_; + gfx::ImageSkia* theme_overlay_image_; int top_area_height_; // Images for the sides of the frame. - const SkBitmap* left_edge_; - const SkBitmap* top_edge_; - const SkBitmap* right_edge_; - const SkBitmap* bottom_edge_; + const gfx::ImageSkia* left_edge_; + const gfx::ImageSkia* top_edge_; + const gfx::ImageSkia* right_edge_; + const gfx::ImageSkia* bottom_edge_; // Images for the corners of the frame. - const SkBitmap* top_left_corner_; - const SkBitmap* top_right_corner_; - const SkBitmap* bottom_left_corner_; - const SkBitmap* bottom_right_corner_; + const gfx::ImageSkia* top_left_corner_; + const gfx::ImageSkia* top_right_corner_; + const gfx::ImageSkia* bottom_left_corner_; + const gfx::ImageSkia* bottom_right_corner_; // Attributes for maximized window painting. // TODO(jamescook): Remove all these. - SkBitmap* maximized_top_left_; - SkBitmap* maximized_top_right_; + gfx::ImageSkia* maximized_top_left_; + gfx::ImageSkia* maximized_top_right_; int maximized_top_offset_; int theme_background_y_; diff --git a/ui/views/window/window_resources.h b/ui/views/window/window_resources.h index 14afc43..0dd0dc0 100644 --- a/ui/views/window/window_resources.h +++ b/ui/views/window/window_resources.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,25 +6,27 @@ #define UI_VIEWS_WINDOW_WINDOW_RESOURCES_H_ #pragma once -class SkBitmap; +namespace gfx { +class ImageSkia; +} namespace views { -typedef int FramePartBitmap; +typedef int FramePartImage; /////////////////////////////////////////////////////////////////////////////// // WindowResources // -// An interface implemented by an object providing bitmaps to render the +// An interface implemented by an object providing images to render the // contents of a window frame. The Window may swap in different // implementations of this interface to render different modes. The definition -// of FramePartBitmap depends on the implementation. +// of FramePartImage depends on the implementation. // class WindowResources { public: virtual ~WindowResources() {} - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const = 0; + virtual gfx::ImageSkia* GetPartImage(FramePartImage part) const = 0; }; } // namespace views |