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

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: Clean up and rebase to 173167 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
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..d387eeb1df7ee981774eff451ed475ae8e1e43ff 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/gl_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"
@@ -331,6 +332,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_SwapGLCompositorFrame,
+ OnMsgSwapGLCompositorFrame)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnMsgUpdateRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnMsgUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck)
@@ -1509,6 +1512,26 @@ void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped(
gpu_process_host_id);
}
+void RenderWidgetHostImpl::OnMsgSwapGLCompositorFrame(
+ const cc::GLCompositorFrame& 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_)
piman 2012/12/14 22:02:22 nit: needs braces per style
aelias_OOO_until_Jul13 2012/12/15 00:06:17 Done.
+ view_->UpdateFrameInfo(
+ gfx::Vector2d(static_cast<int>(scroll_offset.x()),
piman 2012/12/14 22:02:22 Use gfx::ToFlooredVector2d Should it be Rounded in
aelias_OOO_until_Jul13 2012/12/15 00:06:17 Switched to rounded. On Android, the float is cur
+ static_cast<int>(scroll_offset.y())),
+ frame.metadata.page_scale_factor,
+ frame.metadata.min_page_scale_factor,
+ frame.metadata.max_page_scale_factor,
+ gfx::Size(static_cast<int>(content_size.width()),
piman 2012/12/14 22:02:22 use gfx::ToFlooredSize Should it be Ceiled?
aelias_OOO_until_Jul13 2012/12/15 00:06:17 Switched to Ceiled.
+ static_cast<int>(content_size.height())));
+#endif
+}
+
void RenderWidgetHostImpl::OnMsgUpdateRect(
const ViewHostMsg_UpdateRect_Params& params) {
TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgUpdateRect");

Powered by Google App Engine
This is Rietveld 408576698