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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 12746009: Revert 189969 "Add RenderWidgetHost::GetSnapshotFromRenderer met..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1450/src/
Patch Set: Created 7 years, 9 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: content/browser/renderer_host/render_widget_host_impl.cc
===================================================================
--- content/browser/renderer_host/render_widget_host_impl.cc (revision 190011)
+++ content/browser/renderer_host/render_widget_host_impl.cc (working copy)
@@ -25,7 +25,6 @@
#include "content/browser/gpu/gpu_surface_tracker.h"
#include "content/browser/renderer_host/backing_store.h"
#include "content/browser/renderer_host/backing_store_manager.h"
-#include "content/browser/renderer_host/dip_util.h"
#include "content/browser/renderer_host/gesture_event_filter.h"
#include "content/browser/renderer_host/overscroll_controller.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
@@ -392,7 +391,6 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_WindowlessPluginDummyWindowDestroyed,
OnWindowlessPluginDummyWindowDestroyed)
#endif
- IPC_MESSAGE_HANDLER(ViewHostMsg_Snapshot, OnSnapshot)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP_EX()
@@ -575,9 +573,9 @@
if (view_ && is_accelerated_compositing_active_) {
TRACE_EVENT0("browser",
"RenderWidgetHostImpl::CopyFromBackingStore::FromCompositingSurface");
- gfx::Rect accelerated_copy_rect = src_subrect.IsEmpty() ?
+ gfx::Rect copy_rect = src_subrect.IsEmpty() ?
gfx::Rect(view_->GetViewBounds().size()) : src_subrect;
- view_->CopyFromCompositingSurface(accelerated_copy_rect,
+ view_->CopyFromCompositingSurface(copy_rect,
accelerated_dst_size,
callback);
return;
@@ -1251,39 +1249,6 @@
Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info));
}
-void RenderWidgetHostImpl::GetSnapshotFromRenderer(
- const gfx::Rect& src_subrect,
- const base::Callback<void(bool, const SkBitmap&)>& callback) {
- TRACE_EVENT0("browser", "RenderWidgetHostImpl::GetSnapshotFromRenderer");
- pending_snapshots_.push(callback);
-
- gfx::Rect copy_rect = src_subrect.IsEmpty() ?
- gfx::Rect(view_->GetViewBounds().size()) : src_subrect;
-
- gfx::Rect copy_rect_in_pixel = ConvertRectToPixel(view_, copy_rect);
- Send(new ViewMsg_Snapshot(GetRoutingID(), copy_rect_in_pixel));
-}
-
-void RenderWidgetHostImpl::OnSnapshot(bool success,
- const SkBitmap& bitmap) {
- if (pending_snapshots_.size() == 0) {
- LOG(ERROR) << "RenderWidgetHostImpl::OnSnapshot: "
- "Received a snapshot that was not requested.";
- return;
- }
-
- base::Callback<void(bool, const SkBitmap&)> callback =
- pending_snapshots_.front();
- pending_snapshots_.pop();
-
- if (!success) {
- callback.Run(success, SkBitmap());
- return;
- }
-
- callback.Run(success, bitmap);
-}
-
void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) {
Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval));
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698