Chromium Code Reviews| Index: chrome/browser/ui/views/theme_helpers.cc |
| =================================================================== |
| --- chrome/browser/ui/views/theme_helpers.cc (revision 85672) |
| +++ chrome/browser/ui/views/theme_helpers.cc (working copy) |
| @@ -9,7 +9,6 @@ |
| #include <atltheme.h> |
| #include "base/logging.h" |
| -#include "skia/ext/bitmap_platform_device_win.h" |
| #include "third_party/skia/include/effects/SkGradientShader.h" |
| #include "ui/gfx/canvas_skia.h" |
| @@ -32,10 +31,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 = skia::BeginPlatformPaint(&canvas); |
| RECT rect = { 0, 0, width, 1 }; |
| theme.DrawThemeBackground(dc, 0, 0, &rect, NULL); |
| - canvas.endPlatformPaint(); |
| + skia::EndPlatformPaint(&canvas); |
| } else { |
| // On Windows 2000 or Windows XP+ with the Classic theme selected, we need |
| // to build our own gradient using system colors. |
| @@ -64,11 +63,12 @@ |
| // 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); |
| + SkDevice& device = canvas.getTopDevice(); |
| + const SkBitmap& bitmap = device.accessBitmap(false); |
| + SkAutoLockPixels lock(bitmap); |
|
alokp
2011/05/19 18:15:15
I do not think you need to lock pixels here.
Jeff Timanus
2011/05/19 20:38:29
According to the docs in SkBitmap.h on getColor, t
|
| + |
| + *c1 = 0xFF000000 | bitmap.getColor(x1, 0); |
| + *c2 = 0xFF000000 | bitmap.getColor(x2, 0); |
| } |
| void GetDarkLineColor(SkColor* dark_color) { |