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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use IPC? Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 OnQueueSyntheticGesture) 456 OnQueueSyntheticGesture)
457 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) 457 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady)
458 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone) 458 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderProcessGone, OnRenderProcessGone)
459 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) 459 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose)
460 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, 460 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK,
461 OnUpdateScreenRectsAck) 461 OnUpdateScreenRectsAck)
462 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) 462 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove)
463 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) 463 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText)
464 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, 464 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
465 msg_is_ok = OnSwapCompositorFrame(msg)) 465 msg_is_ok = OnSwapCompositorFrame(msg))
466 IPC_MESSAGE_HANDLER(ViewHostMsg_DeliverPayload, OnDeliverPayload)
466 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped) 467 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped)
467 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 468 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
468 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) 469 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
469 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) 470 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
470 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) 471 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
471 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) 472 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
472 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTouchEventEmulationEnabled, 473 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTouchEventEmulationEnabled,
473 OnSetTouchEventEmulationEnabled) 474 OnSetTouchEventEmulationEnabled)
474 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, 475 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged,
475 OnTextInputTypeChanged) 476 OnTextInputTypeChanged)
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 // chrome/browser/extensions/api/cast_streaming/performance_test.cc 1480 // chrome/browser/extensions/api/cast_streaming/performance_test.cc
1480 UNSHIPPED_TRACE_EVENT0("test_fps", 1481 UNSHIPPED_TRACE_EVENT0("test_fps",
1481 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame")); 1482 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame"));
1482 ViewHostMsg_SwapCompositorFrame::Param param; 1483 ViewHostMsg_SwapCompositorFrame::Param param;
1483 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, &param)) 1484 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, &param))
1484 return false; 1485 return false;
1485 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); 1486 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame);
1486 uint32 output_surface_id = param.a; 1487 uint32 output_surface_id = param.a;
1487 param.b.AssignTo(frame.get()); 1488 param.b.AssignTo(frame.get());
1488 1489
1490 for (int i = 0; i < frame->metadata.payload.size(); ++i) {
1491 OnDeliverPayload(frame->metadata.payload[i]);
mkosiba (inactive) 2014/05/06 22:30:33 the receiving end on browser side
1492 }
1493 frame->metadata.payload.clear();
1494
1489 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) 1495 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++)
1490 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]); 1496 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]);
1491 1497
1492 input_router_->OnViewUpdated( 1498 input_router_->OnViewUpdated(
1493 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata)); 1499 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata));
1494 1500
1495 if (view_) { 1501 if (view_) {
1496 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass()); 1502 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass());
1497 view_->DidReceiveRendererFrame(); 1503 view_->DidReceiveRendererFrame();
1498 } else { 1504 } else {
1499 cc::CompositorFrameAck ack; 1505 cc::CompositorFrameAck ack;
1500 if (frame->gl_frame_data) { 1506 if (frame->gl_frame_data) {
1501 ack.gl_frame_data = frame->gl_frame_data.Pass(); 1507 ack.gl_frame_data = frame->gl_frame_data.Pass();
1502 ack.gl_frame_data->sync_point = 0; 1508 ack.gl_frame_data->sync_point = 0;
1503 } else if (frame->delegated_frame_data) { 1509 } else if (frame->delegated_frame_data) {
1504 cc::TransferableResource::ReturnResources( 1510 cc::TransferableResource::ReturnResources(
1505 frame->delegated_frame_data->resource_list, 1511 frame->delegated_frame_data->resource_list,
1506 &ack.resources); 1512 &ack.resources);
1507 } else if (frame->software_frame_data) { 1513 } else if (frame->software_frame_data) {
1508 ack.last_software_frame_id = frame->software_frame_data->id; 1514 ack.last_software_frame_id = frame->software_frame_data->id;
1509 } 1515 }
1510 SendSwapCompositorFrameAck(routing_id_, output_surface_id, 1516 SendSwapCompositorFrameAck(routing_id_, output_surface_id,
1511 process_->GetID(), ack); 1517 process_->GetID(), ack);
1512 } 1518 }
1513 return true; 1519 return true;
1514 } 1520 }
1515 1521
1522 void RenderWidgetHostImpl::OnDeliverPayload(const IPC::Message& payload) {
1523 // Filter any RenderWidgetHostImpl-specific messages here.
1524 if (delegate_)
1525 delegate_->DispatchMessageWithSwapFrame(payload);
1526 }
1527
1516 void RenderWidgetHostImpl::OnFlingingStopped() { 1528 void RenderWidgetHostImpl::OnFlingingStopped() {
1517 if (view_) 1529 if (view_)
1518 view_->DidStopFlinging(); 1530 view_->DidStopFlinging();
1519 } 1531 }
1520 1532
1521 void RenderWidgetHostImpl::OnUpdateRect( 1533 void RenderWidgetHostImpl::OnUpdateRect(
1522 const ViewHostMsg_UpdateRect_Params& params) { 1534 const ViewHostMsg_UpdateRect_Params& params) {
1523 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); 1535 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect");
1524 TimeTicks paint_start = TimeTicks::Now(); 1536 TimeTicks paint_start = TimeTicks::Now();
1525 1537
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 } 2354 }
2343 } 2355 }
2344 2356
2345 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { 2357 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() {
2346 if (view_) 2358 if (view_)
2347 return view_->PreferredReadbackFormat(); 2359 return view_->PreferredReadbackFormat();
2348 return SkBitmap::kARGB_8888_Config; 2360 return SkBitmap::kARGB_8888_Config;
2349 } 2361 }
2350 2362
2351 } // namespace content 2363 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698