| Index: content/renderer/render_widget.cc
|
| ===================================================================
|
| --- content/renderer/render_widget.cc (revision 190011)
|
| +++ content/renderer/render_widget.cc (working copy)
|
| @@ -321,7 +321,6 @@
|
| IPC_MESSAGE_HANDLER(ViewMsg_ImeBatchStateChanged, OnImeBatchStateChanged)
|
| IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded)
|
| #endif
|
| - IPC_MESSAGE_HANDLER(ViewMsg_Snapshot, OnSnapshot)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| return handled;
|
| @@ -1821,50 +1820,6 @@
|
| Send(new ViewHostMsg_PaintAtSize_ACK(routing_id_, tag, bounds.size()));
|
| }
|
|
|
| -void RenderWidget::OnSnapshot(const gfx::Rect& src_subrect) {
|
| - SkBitmap snapshot;
|
| -
|
| - if (OnSnapshotHelper(src_subrect, &snapshot)) {
|
| - Send(new ViewHostMsg_Snapshot(routing_id(), true, snapshot));
|
| - } else {
|
| - Send(new ViewHostMsg_Snapshot(routing_id(), false, SkBitmap()));
|
| - }
|
| -}
|
| -
|
| -bool RenderWidget::OnSnapshotHelper(const gfx::Rect& src_subrect,
|
| - SkBitmap* snapshot) {
|
| - base::TimeTicks beginning_time = base::TimeTicks::Now();
|
| -
|
| - if (!webwidget_ || src_subrect.IsEmpty())
|
| - return false;
|
| -
|
| - gfx::Rect viewport_size = gfx::IntersectRects(
|
| - src_subrect, gfx::Rect(physical_backing_size_));
|
| -
|
| - skia::RefPtr<SkCanvas> canvas = skia::AdoptRef(
|
| - skia::CreatePlatformCanvas(viewport_size.width(),
|
| - viewport_size.height(),
|
| - true,
|
| - NULL,
|
| - skia::RETURN_NULL_ON_FAILURE));
|
| - if (!canvas.get())
|
| - return false;
|
| -
|
| - canvas->save();
|
| - webwidget_->layout();
|
| -
|
| - PaintRect(viewport_size, viewport_size.origin(), canvas.get());
|
| - canvas->restore();
|
| -
|
| - const SkBitmap& bitmap = skia::GetTopDevice(*canvas)->accessBitmap(false);
|
| - if (!bitmap.copyTo(snapshot, SkBitmap::kARGB_8888_Config))
|
| - return false;
|
| -
|
| - UMA_HISTOGRAM_TIMES("Renderer4.Snapshot",
|
| - base::TimeTicks::Now() - beginning_time);
|
| - return true;
|
| -}
|
| -
|
| void RenderWidget::OnRepaint(const gfx::Size& size_to_paint) {
|
| // During shutdown we can just ignore this message.
|
| if (!webwidget_)
|
|
|