| Index: chrome/browser/ui/views/theme_helpers.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/theme_helpers.cc (revision 82144)
|
| +++ chrome/browser/ui/views/theme_helpers.cc (working copy)
|
| @@ -23,7 +23,8 @@
|
| // those so calling code can use them to create gradient brushes for use in
|
| // rendering in other directions.
|
|
|
| - gfx::CanvasSkia canvas(width, 1, true);
|
| + gfx::CanvasSkia canvas;
|
| + canvas.Init(width, 1, true);
|
|
|
| // Render the Rebar gradient into the DIB
|
| CTheme theme;
|
| @@ -32,10 +33,10 @@
|
| // On Windows XP+, if using a Theme, we can ask the theme to render the
|
| // gradient for us.
|
| if (!theme.IsThemeNull()) {
|
| - HDC dc = canvas.beginPlatformPaint();
|
| + HDC dc = canvas.BeginPlatformPaint();
|
| RECT rect = { 0, 0, width, 1 };
|
| theme.DrawThemeBackground(dc, 0, 0, &rect, NULL);
|
| - canvas.endPlatformPaint();
|
| + canvas.EndPlatformPaint();
|
| } else {
|
| // On Windows 2000 or Windows XP+ with the Classic theme selected, we need
|
| // to build our own gradient using system colors.
|
| @@ -57,18 +58,18 @@
|
| // the gradient.
|
| gradient_shader->unref();
|
| paint.setStyle(SkPaint::kFill_Style);
|
| - canvas.drawRectCoords(SkIntToScalar(0), SkIntToScalar(0),
|
| - SkIntToScalar(width), SkIntToScalar(1), paint);
|
| + canvas.skia_canvas()->drawRectCoords(
|
| + SkIntToScalar(0), SkIntToScalar(0),
|
| + SkIntToScalar(width), SkIntToScalar(1), paint);
|
| }
|
|
|
| // Extract the color values from the selected pixels
|
| // The | in the following operations forces the alpha to 0xFF. This is
|
| // needed as windows sets the alpha to 0 when it renders.
|
| - skia::BitmapPlatformDevice& device =
|
| - static_cast<skia::BitmapPlatformDevice&>(
|
| - canvas.getTopPlatformDevice());
|
| - *c1 = 0xFF000000 | device.getColorAt(x1, 0);
|
| - *c2 = 0xFF000000 | device.getColorAt(x2, 0);
|
| + const SkBitmap& bitmap =
|
| + canvas.skia_canvas()->getTopDevice()->accessBitmap(false);
|
| + *c1 = 0xFF000000 | bitmap.getColor(x1, 0);
|
| + *c2 = 0xFF000000 | bitmap.getColor(x2, 0);
|
| }
|
|
|
| void GetDarkLineColor(SkColor* dark_color) {
|
|
|