Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(866)

Unified Diff: views/controls/table/native_table_win.cc

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: views/controls/table/native_table_win.cc
diff --git a/views/controls/table/native_table_win.cc b/views/controls/table/native_table_win.cc
index 6f8472cceb61c7893b4de6098230aebeec382b53..91d46c996b4347892717c183df5fa0aeb12115b7 100644
--- a/views/controls/table/native_table_win.cc
+++ b/views/controls/table/native_table_win.cc
@@ -395,7 +395,7 @@ void NativeTableWin::CreateNativeControl() {
// rect does not include the icon).
gfx::CanvasSkia canvas(kImageSize, kImageSize, false);
// Make the background completely transparent.
- canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
+ canvas.sk_canvas()->drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
{
base::win::ScopedHICON empty_icon(
IconUtil::CreateHICONFromSkBitmap(canvas.ExtractBitmap()));
@@ -533,7 +533,7 @@ LRESULT NativeTableWin::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) {
// 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.sk_canvas()->drawColor(
skia::COLORREFToSkColor(GetSysColor(bg_color_index)),
SkXfermode::kSrc_Mode);
// + 1 for padding (we declared the image as 18x18 in the list-
@@ -551,9 +551,9 @@ LRESULT NativeTableWin::OnCustomDraw(NMLVCUSTOMDRAW* draw_info) {
(intersection.right - intersection.left);
to_draw.bottom = to_draw.top +
(intersection.bottom - intersection.top);
- skia::DrawToNativeContext(&canvas, draw_info->nmcd.hdc,
- intersection.left, intersection.top,
- &to_draw);
+ skia::DrawToNativeContext(canvas.sk_canvas(), draw_info->nmcd.hdc,
+ intersection.left, intersection.top,
+ &to_draw);
r = CDRF_SKIPDEFAULT;
}
}

Powered by Google App Engine
This is Rietveld 408576698