| Index: views/controls/table/table_view.cc
|
| ===================================================================
|
| --- views/controls/table/table_view.cc (revision 82144)
|
| +++ views/controls/table/table_view.cc (working copy)
|
| @@ -807,9 +807,10 @@
|
| // 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::CanvasSkia canvas(kImageSize, kImageSize, false);
|
| + gfx::CanvasSkia canvas;
|
| + canvas.Init(kImageSize, kImageSize, false);
|
| // Make the background completely transparent.
|
| - canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
|
| + canvas.skia_canvas()->drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
|
| HICON empty_icon =
|
| IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap());
|
| ImageList_AddIcon(image_list, empty_icon);
|
| @@ -1153,12 +1154,13 @@
|
| HDC dc = GetDC(GetNativeControlHWND());
|
| gfx::Font font = GetAltTextFont();
|
| gfx::Rect bounds = GetAltTextBounds();
|
| - gfx::CanvasSkia canvas(bounds.width(), bounds.height(), false);
|
| + gfx::CanvasSkia canvas;
|
| + canvas.Init(bounds.width(), bounds.height(), false);
|
| // Pad by 1 for halo.
|
| canvas.DrawStringWithHalo(alt_text_, font, SK_ColorDKGRAY, SK_ColorWHITE, 1,
|
| 1, bounds.width() - 2, bounds.height() - 2,
|
| gfx::CanvasSkia::DefaultCanvasTextAlignment());
|
| - canvas.getTopPlatformDevice().drawToHDC(dc, bounds.x(), bounds.y(), NULL);
|
| + canvas.BlitToNativeContext(gfx::Rect(bounds.size()), bounds.origin(), dc);
|
| ReleaseDC(GetNativeControlHWND(), dc);
|
| }
|
|
|
| @@ -1236,8 +1238,10 @@
|
| client_rect.top += content_offset_;
|
| // Make sure the region need to paint is visible.
|
| if (IntersectRect(&intersection, &icon_rect, &client_rect)) {
|
| - gfx::CanvasSkia canvas(icon_rect.right - icon_rect.left,
|
| - icon_rect.bottom - icon_rect.top, false);
|
| + gfx::CanvasSkia canvas;
|
| + canvas.Init(icon_rect.right - icon_rect.left,
|
| + icon_rect.bottom - icon_rect.top,
|
| + false);
|
|
|
| // It seems the state in nmcd.uItemState is not correct.
|
| // We'll retrieve it explicitly.
|
| @@ -1256,7 +1260,7 @@
|
| // NOTE: This may be invoked without the ListView filling in the
|
| // background (or rather windows paints background, then invokes
|
| // this twice). As such, we always fill in the background.
|
| - canvas.drawColor(
|
| + canvas.skia_canvas()->drawColor(
|
| skia::COLORREFToSkColor(GetSysColor(bg_color_index)),
|
| SkXfermode::kSrc_Mode);
|
| // + 1 for padding (we declared the image as 18x18 in the list-
|
| @@ -1273,10 +1277,10 @@
|
| (intersection.right - intersection.left);
|
| to_draw.bottom = to_draw.top +
|
| (intersection.bottom - intersection.top);
|
| - canvas.getTopPlatformDevice().drawToHDC(draw_info->nmcd.hdc,
|
| - intersection.left,
|
| - intersection.top,
|
| - &to_draw);
|
| + canvas.BlitToNativeContext(
|
| + gfx::Rect(to_draw),
|
| + gfx::Point(intersection.left, intersection.top),
|
| + draw_info->nmcd.hdc);
|
| r = CDRF_SKIPDEFAULT;
|
| }
|
| }
|
|
|