| Index: ui/gfx/canvas_skia_win.cc
|
| ===================================================================
|
| --- ui/gfx/canvas_skia_win.cc (revision 85672)
|
| +++ ui/gfx/canvas_skia_win.cc (working copy)
|
| @@ -138,7 +138,7 @@
|
| // Changes the alpha of the given bitmap.
|
| // If |fade_to_right| is true then the rect fades from opaque to clear,
|
| // otherwise the rect fades from clear to opaque.
|
| -void FadeBitmapRect(skia::BitmapPlatformDevice& bmp_device,
|
| +void FadeBitmapRect(SkDevice& bmp_device,
|
| const gfx::Rect& rect,
|
| bool fade_to_right) {
|
| SkBitmap bmp = bmp_device.accessBitmap(true);
|
| @@ -164,14 +164,14 @@
|
| // this function draws black on white. It then uses the intensity of black
|
| // to determine how much alpha to use. The text is drawn in |gfx_text_rect| and
|
| // clipped to |gfx_draw_rect|.
|
| -void DrawTextAndClearBackground(skia::BitmapPlatformDevice& bmp_device,
|
| +void DrawTextAndClearBackground(SkDevice& bmp_device,
|
| HFONT font,
|
| COLORREF text_color,
|
| const string16& text,
|
| int flags,
|
| const gfx::Rect& gfx_text_rect,
|
| const gfx::Rect& gfx_draw_rect) {
|
| - HDC hdc = bmp_device.BeginPlatformPaint();
|
| + HDC hdc = skia::platform_util::BeginPlatformPaint(&bmp_device);
|
|
|
| // Clear the background by filling with white.
|
| HBRUSH fill_brush = static_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
|
| @@ -218,14 +218,14 @@
|
| }
|
| }
|
|
|
| - bmp_device.EndPlatformPaint();
|
| + skia::platform_util::EndPlatformPaint(&bmp_device);
|
| }
|
|
|
| // Draws the given text with a fade out gradient. |bmp_device| is a bitmap
|
| // that is used to temporary drawing. The text is drawn in |text_rect| and
|
| // clipped to |draw_rect|.
|
| void DrawTextGradientPart(HDC hdc,
|
| - skia::BitmapPlatformDevice& bmp_device,
|
| + SkDevice& bmp_device,
|
| const string16& text,
|
| const SkColor& color,
|
| HFONT font,
|
| @@ -238,11 +238,11 @@
|
| FadeBitmapRect(bmp_device, draw_rect, fade_to_right);
|
| BLENDFUNCTION blend = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
|
|
|
| - HDC bmp_hdc = bmp_device.BeginPlatformPaint();
|
| + HDC bmp_hdc = skia::platform_util::BeginPlatformPaint(&bmp_device);
|
| AlphaBlend(hdc, draw_rect.x(), draw_rect.y(), draw_rect.width(),
|
| draw_rect.height(), bmp_hdc, draw_rect.x(), draw_rect.y(),
|
| draw_rect.width(), draw_rect.height(), blend);
|
| - bmp_device.EndPlatformPaint();
|
| + skia::platform_util::EndPlatformPaint(&bmp_device);
|
| }
|
|
|
| enum PrimarySide {
|
| @@ -365,8 +365,8 @@
|
| // Windows will have cleared the alpha channel of the text we drew. Assume
|
| // we're drawing to an opaque surface, or at least the text rect area is
|
| // opaque.
|
| - getTopPlatformDevice().makeOpaque(clip.fLeft, clip.fTop,
|
| - clip.width(), clip.height());
|
| + skia::platform_util::MakeOpaque(&getTopDevice(), clip.fLeft,
|
| + clip.fTop, clip.width(), clip.height());
|
| }
|
|
|
| void CanvasSkia::DrawStringInt(const string16& text,
|
| @@ -430,11 +430,12 @@
|
| // opaque. We have to do this first since pixelShouldGetHalo will check for
|
| // 0 to see if a pixel has been modified to transparent, and black text that
|
| // Windows draw will look transparent to it!
|
| - text_canvas.getTopPlatformDevice().makeOpaque(0, 0, w + 2, h + 2);
|
| + skia::platform_util::MakeOpaque(&text_canvas.getTopDevice(), 0, 0,
|
| + w + 2, h + 2);
|
|
|
| uint32_t halo_premul = SkPreMultiplyColor(halo_color);
|
| SkBitmap& text_bitmap = const_cast<SkBitmap&>(
|
| - text_canvas.getTopPlatformDevice().accessBitmap(true));
|
| + text_canvas.getTopDevice().accessBitmap(true));
|
| for (int cur_y = 0; cur_y < h + 2; cur_y++) {
|
| uint32_t* text_row = text_bitmap.getAddr32(0, cur_y);
|
| for (int cur_x = 0; cur_x < w + 2; cur_x++) {
|
| @@ -553,7 +554,7 @@
|
| text_rect.set_width(text_rect.width() + offset_x);
|
|
|
| // Create a temporary bitmap to draw the gradient to.
|
| - scoped_ptr<skia::BitmapPlatformDevice> gradient_bitmap(
|
| + scoped_ptr<SkDevice> gradient_bitmap(
|
| skia::BitmapPlatformDevice::create(
|
| display_rect.width(), display_rect.height(), false, NULL));
|
| DCHECK(gradient_bitmap.get());
|
|
|