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

Unified Diff: chrome/browser/ui/views/theme_helpers.cc

Issue 6879013: skia::PlatformCanvas is being deprecated. Going forward we will use gfx::Canvas wherever we need ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/theme_install_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/theme_install_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698