summaryrefslogtreecommitdiffstats
path: root/ui/views/controls
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 16:51:16 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-24 16:51:16 +0000
commitde13f35d1ffedf90f791fa5bb127697094771c2c (patch)
treefac7173e5bcc6d5f8988043d657f012d45c68e81 /ui/views/controls
parente3301c30d83b7b9c895fba14d1f78491906c86b7 (diff)
downloadchromium_src-de13f35d1ffedf90f791fa5bb127697094771c2c.zip
chromium_src-de13f35d1ffedf90f791fa5bb127697094771c2c.tar.gz
chromium_src-de13f35d1ffedf90f791fa5bb127697094771c2c.tar.bz2
Cleanup gfx::Canvas now that 10562027 has landed
Bug=None Test=Compiles on Mac and CrOS R=oshima,sky TBR=sadrul,sail Review URL: https://chromiumcodereview.appspot.com/10701063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls')
-rw-r--r--ui/views/controls/glow_hover_controller.cc2
-rw-r--r--ui/views/controls/menu/native_menu_win.cc1
-rw-r--r--ui/views/controls/table/table_view_win.cc10
-rw-r--r--ui/views/controls/tree/tree_view_win.cc6
4 files changed, 12 insertions, 7 deletions
diff --git a/ui/views/controls/glow_hover_controller.cc b/ui/views/controls/glow_hover_controller.cc
index e86be4d..71785f0 100644
--- a/ui/views/controls/glow_hover_controller.cc
+++ b/ui/views/controls/glow_hover_controller.cc
@@ -98,7 +98,7 @@ void GlowHoverController::Draw(gfx::Canvas* canvas,
radius * 2, radius * 2), paint);
}
gfx::ImageSkia result = gfx::ImageSkiaOperations::CreateMaskedImage(
- gfx::ImageSkia(hover_canvas.ExtractImageSkiaRep()), mask_image);
+ gfx::ImageSkia(hover_canvas.ExtractImageRep()), mask_image);
canvas->DrawImageInt(result, (view_->width() - mask_image.width()) / 2,
(view_->height() - mask_image.height()) / 2);
}
diff --git a/ui/views/controls/menu/native_menu_win.cc b/ui/views/controls/menu/native_menu_win.cc
index c04a2bd..44df996 100644
--- a/ui/views/controls/menu/native_menu_win.cc
+++ b/ui/views/controls/menu/native_menu_win.cc
@@ -281,6 +281,7 @@ class NativeMenuWin::MenuHostWindow {
(height - kItemTopMargin - kItemBottomMargin -
config.check_height) / 2;
gfx::Canvas canvas(gfx::Size(config.check_width, config.check_height),
+ ui::SCALE_FACTOR_100P,
false);
NativeTheme::ExtraParams extra;
extra.menu_check.is_radio = false;
diff --git a/ui/views/controls/table/table_view_win.cc b/ui/views/controls/table/table_view_win.cc
index e9b8765..1538dd8 100644
--- a/ui/views/controls/table/table_view_win.cc
+++ b/ui/views/controls/table/table_view_win.cc
@@ -809,10 +809,11 @@ HWND TableView::CreateNativeControl(HWND parent_container) {
// We create 2 phony images because we are going to switch images at every
// refresh in order to force a refresh of the icon area (somehow the clip
// rect does not include the icon).
- gfx::Canvas canvas(gfx::Size(kImageSize, kImageSize), false);
+ gfx::Canvas canvas(gfx::Size(kImageSize, kImageSize), ui::SCALE_FACTOR_100P,
+ false);
{
- base::win::ScopedHICON empty_icon(
- IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap()));
+ base::win::ScopedHICON empty_icon(IconUtil::CreateHICONFromSkBitmap(
+ canvas.ExtractImageRep().sk_bitmap()));
ImageList_AddIcon(image_list, empty_icon);
ImageList_AddIcon(image_list, empty_icon);
}
@@ -1154,7 +1155,7 @@ void TableView::PaintAltText() {
HDC dc = GetDC(GetNativeControlHWND());
gfx::Font font = GetAltTextFont();
gfx::Rect bounds = GetAltTextBounds();
- gfx::Canvas canvas(bounds.size(), false);
+ gfx::Canvas canvas(bounds.size(), ui::SCALE_FACTOR_100P, false);
// Pad by 1 for halo.
canvas.DrawStringWithHalo(alt_text_, font, SK_ColorDKGRAY, SK_ColorWHITE, 1,
1, bounds.width() - 2, bounds.height() - 2,
@@ -1240,6 +1241,7 @@ LRESULT TableView::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) {
if (IntersectRect(&intersection, &icon_rect, &client_rect)) {
gfx::Canvas canvas(gfx::Size(icon_rect.right - icon_rect.left,
icon_rect.bottom - icon_rect.top),
+ ui::SCALE_FACTOR_100P,
false);
// It seems the state in nmcd.uItemState is not correct.
diff --git a/ui/views/controls/tree/tree_view_win.cc b/ui/views/controls/tree/tree_view_win.cc
index 5a81519..8fa702a 100644
--- a/ui/views/controls/tree/tree_view_win.cc
+++ b/ui/views/controls/tree/tree_view_win.cc
@@ -691,13 +691,15 @@ HIMAGELIST TreeView::CreateImageList() {
// IDR_FOLDER_CLOSED if they aren't already.
if (model_images[i].width() != width ||
model_images[i].height() != height) {
- gfx::Canvas canvas(gfx::Size(width, height), false);
+ gfx::Canvas canvas(gfx::Size(width, height), ui::SCALE_FACTOR_100P,
+ false);
// Draw our icons into this canvas.
int height_offset = (height - model_images[i].height()) / 2;
int width_offset = (width - model_images[i].width()) / 2;
canvas.DrawImageInt(model_images[i], width_offset, height_offset);
- model_icon = IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap());
+ model_icon = IconUtil::CreateHICONFromSkBitmap(
+ canvas.ExtractImageRep().sk_bitmap());
} else {
model_icon = IconUtil::CreateHICONFromSkBitmap(model_images[i]);
}