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

Unified Diff: chrome/browser/ui/views/theme_helpers.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: chrome/browser/ui/views/theme_helpers.cc
diff --git a/chrome/browser/ui/views/theme_helpers.cc b/chrome/browser/ui/views/theme_helpers.cc
index 17080494af02b8bf762404d7890033f00f88c0f2..e81d875eaa9740b948c601ceba8cc213ac7ca27b 100644
--- a/chrome/browser/ui/views/theme_helpers.cc
+++ b/chrome/browser/ui/views/theme_helpers.cc
@@ -31,7 +31,7 @@ void GetRebarGradientColors(int width, int x1, int x2,
// On Windows XP+, if using a Theme, we can ask the theme to render the
// gradient for us.
if (!theme.IsThemeNull()) {
- skia::ScopedPlatformPaint scoped_platform_paint(&canvas);
+ skia::ScopedPlatformPaint scoped_platform_paint(canvas.sk_canvas());
HDC dc = scoped_platform_paint.GetPlatformSurface();
RECT rect = { 0, 0, width, 1 };
theme.DrawThemeBackground(dc, 0, 0, &rect, NULL);
@@ -56,14 +56,15 @@ void GetRebarGradientColors(int width, int x1, int x2,
// the gradient.
gradient_shader->unref();
paint.setStyle(SkPaint::kFill_Style);
- canvas.drawRectCoords(SkIntToScalar(0), SkIntToScalar(0),
- SkIntToScalar(width), SkIntToScalar(1), paint);
+ canvas.sk_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.
- SkDevice* device = skia::GetTopDevice(canvas);
+ SkDevice* device = skia::GetTopDevice(*canvas.sk_canvas());
const SkBitmap& bitmap = device->accessBitmap(false);
SkAutoLockPixels lock(bitmap);

Powered by Google App Engine
This is Rietveld 408576698