diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 04:46:05 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 04:46:05 +0000 |
commit | 1e8ebce27abc8948772b2db088e9bcb217a539e4 (patch) | |
tree | bcd89eeff9feb6d49f2438ed81b4eeab52ce92e6 /ui | |
parent | 47a34760bc52b0b3f0edd616d10ac7b010f9f253 (diff) | |
download | chromium_src-1e8ebce27abc8948772b2db088e9bcb217a539e4.zip chromium_src-1e8ebce27abc8948772b2db088e9bcb217a539e4.tar.gz chromium_src-1e8ebce27abc8948772b2db088e9bcb217a539e4.tar.bz2 |
Converts remainder of ui (except for ui/app_list) and chrome/browser/ui/views/frame to use ImageSkia
Do conversion using the same sed script as for 10437006
Modified by hand afterwards:
1 chrome/browser/download/download_util.cc
2 chrome/browser/ui/panels/panel_browser_frame_view.cc
3 chrome/browser/ui/panels/panel_browser_frame_view.h
4 chrome/browser/ui/toolbar/wrench_menu_model.cc
5 chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
6 chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h
7 chrome/browser/ui/views/constrained_window_views.cc
8 chrome/browser/ui/views/frame/glass_browser_frame_view.cc
9 chrome/browser/ui/views/tab_icon_view.h
10 ui/base/dragdrop/drag_utils.h
11 ui/base/dragdrop/drag_utils_gtk.cc
12 ui/base/dragdrop/drag_utils_win.cc
13 ui/base/native_theme/native_theme_android.cc
14 ui/base/native_theme/native_theme_android.h
15 ui/base/native_theme/native_theme_base.cc
16 ui/base/native_theme/native_theme_base.h
17 ui/views/widget/native_widget_private.h
18 ui/views/window/frame_background.h
19 ui/views/window/window_resources.h
Line wrapping and include fixes
chrome/browser/ui/views/frame/app_panel_browser_frame_view.cc
1 chrome/browser/ui/views/frame/browser_view.cc
2 chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
3 ui/base/dragdrop/drag_utils_aura.cc
4 ui/base/dragdrop/os_exchange_data_provider_aura.h
5 ui/base/native_theme/native_theme_aura.cc
6 ui/views/button_drag_utils.h
7 ui/views/painter.cc
8 ui/views/painter.h
9 ui/views/widget/native_widget_aura.cc
10 ui/views/widget/widget_delegate.h
11 ui/views/window/custom_frame_view.cc
12 ui/views/window/custom_frame_view.h
Test=Compiles, Webkit layout tests fast/ pass
Bug=124566
Review URL: https://chromiumcodereview.appspot.com/10447053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
32 files changed, 284 insertions, 253 deletions
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 |