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

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

Issue 11316128: Send compositor frame IPC with metadata. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix compile errors on mac/win Created 8 years 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/cc_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 832de4364ab261ff7f303fa5d559cc0844ac9447..c669a293a4cf1a6d97ceaec05b808950af5cf669 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -17,6 +17,7 @@
#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
+#include "cc/compositor_frame.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_process_host_ui_shim.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
@@ -54,6 +55,7 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/gfx/size_conversions.h"
#include "ui/gfx/skbitmap_operations.h"
+#include "ui/gfx/vector2d_conversions.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/plugins/npapi/webplugin.h"
@@ -331,6 +333,8 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_PaintAtSize_ACK, OnMsgPaintAtSizeAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped,
OnCompositorSurfaceBuffersSwapped)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SwapCompositorFrame,
+ OnMsgSwapCompositorFrame)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnMsgUpdateRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnMsgUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck)
@@ -1509,6 +1513,25 @@ void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped(
gpu_process_host_id);
}
+void RenderWidgetHostImpl::OnMsgSwapCompositorFrame(
+ const cc::CompositorFrame& frame) {
+#if defined(OS_ANDROID)
+ gfx::Vector2dF scroll_offset = ScaleVector2d(
+ frame.metadata.root_scroll_offset, frame.metadata.page_scale_factor);
+ gfx::SizeF content_size = ScaleSize(
+ frame.metadata.root_layer_size, frame.metadata.page_scale_factor);
+
+ if (view_) {
+ view_->UpdateFrameInfo(
+ gfx::ToRoundedVector2d(scroll_offset),
+ frame.metadata.page_scale_factor,
+ frame.metadata.min_page_scale_factor,
+ frame.metadata.max_page_scale_factor,
+ gfx::ToCeiledSize(content_size));
+ }
+#endif
+}
+
void RenderWidgetHostImpl::OnMsgUpdateRect(
const ViewHostMsg_UpdateRect_Params& params) {
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgUpdateRect");
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698