Chromium Code Reviews| 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"); |