| Index: webkit/plugins/sad_plugin.cc
|
| ===================================================================
|
| --- webkit/plugins/sad_plugin.cc (revision 82144)
|
| +++ webkit/plugins/sad_plugin.cc (working copy)
|
| @@ -18,18 +18,21 @@
|
| // Make a temporary canvas for the background image.
|
| const int width = plugin_rect.width();
|
| const int height = plugin_rect.height();
|
| - gfx::CanvasSkia canvas(width, height, false);
|
| + gfx::CanvasSkia canvas;
|
| + if (!canvas.Init(width, height, false))
|
| + return;
|
| +
|
| #if defined(OS_MACOSX)
|
| // Flip the canvas, since the context expects flipped data.
|
| - canvas.translate(0, height);
|
| - canvas.scale(1, -1);
|
| + canvas.skia_canvas()->translate(0, height);
|
| + canvas.skia_canvas()->scale(1, -1);
|
| #endif
|
| SkPaint paint;
|
|
|
| paint.setStyle(SkPaint::kFill_Style);
|
| paint.setColor(SK_ColorBLACK);
|
| - canvas.drawRectCoords(0, 0, SkIntToScalar(width), SkIntToScalar(height),
|
| - paint);
|
| + canvas.skia_canvas()->drawRectCoords(
|
| + 0, 0, SkIntToScalar(width), SkIntToScalar(height), paint);
|
| canvas.DrawBitmapInt(sad_plugin_bitmap,
|
| std::max(0, (width - sad_plugin_bitmap.width()) / 2),
|
| std::max(0, (height - sad_plugin_bitmap.height()) / 2));
|
| @@ -38,11 +41,12 @@
|
| // then copy that to the screen than to use the native APIs. The small speed
|
| // penalty is not important when drawing crashed plugins.
|
| #if WEBKIT_USING_SKIA
|
| - gfx::NativeDrawingContext context = skia::BeginPlatformPaint(webcanvas);
|
| - BlitCanvasToContext(context, plugin_rect, &canvas, gfx::Point(0, 0));
|
| + canvas.BlitToNativeContext(gfx::Rect(plugin_rect.size()),
|
| + plugin_rect.origin(), skia::BeginPlatformPaint(webcanvas));
|
| skia::EndPlatformPaint(webcanvas);
|
| #elif WEBKIT_USING_CG
|
| - BlitCanvasToContext(webcanvas, plugin_rect, &canvas, gfx::Point(0, 0));
|
| + canvas.BlitToNativeContext(gfx::Rect(plugin_rect.size()),
|
| + plugin_rect.origin(), webcanvas);
|
| #endif
|
| }
|
|
|
|
|