Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1477 // This trace event is used in | 1477 // This trace event is used in |
| 1478 // chrome/browser/extensions/api/cast_streaming/performance_test.cc | 1478 // chrome/browser/extensions/api/cast_streaming/performance_test.cc |
| 1479 UNSHIPPED_TRACE_EVENT0("test_fps", | 1479 UNSHIPPED_TRACE_EVENT0("test_fps", |
| 1480 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame")); | 1480 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame")); |
| 1481 ViewHostMsg_SwapCompositorFrame::Param param; | 1481 ViewHostMsg_SwapCompositorFrame::Param param; |
| 1482 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) | 1482 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) |
| 1483 return false; | 1483 return false; |
| 1484 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 1484 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
| 1485 uint32 output_surface_id = param.a; | 1485 uint32 output_surface_id = param.a; |
| 1486 param.b.AssignTo(frame.get()); | 1486 param.b.AssignTo(frame.get()); |
| 1487 std::vector<IPC::Message> messages_to_deliver_with_frame; | |
| 1488 messages_to_deliver_with_frame.swap(param.c); | |
| 1489 | |
| 1490 for (std::vector<IPC::Message>::const_iterator i = | |
| 1491 messages_to_deliver_with_frame.begin(); | |
| 1492 i != messages_to_deliver_with_frame.end(); | |
| 1493 ++i) { | |
| 1494 GetProcess()->OnMessageReceived(*i); | |
|
mkosiba (inactive)
2014/05/13 19:15:26
reentrant IPC dispatch seems shady to me.
| |
| 1495 } | |
| 1496 messages_to_deliver_with_frame.clear(); | |
| 1487 | 1497 |
| 1488 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) | 1498 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) |
| 1489 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]); | 1499 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]); |
| 1490 | 1500 |
| 1491 input_router_->OnViewUpdated( | 1501 input_router_->OnViewUpdated( |
| 1492 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata)); | 1502 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata)); |
| 1493 | 1503 |
| 1494 if (view_) { | 1504 if (view_) { |
| 1495 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass()); | 1505 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass()); |
| 1496 view_->DidReceiveRendererFrame(); | 1506 view_->DidReceiveRendererFrame(); |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2336 } | 2346 } |
| 2337 } | 2347 } |
| 2338 | 2348 |
| 2339 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2349 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2340 if (view_) | 2350 if (view_) |
| 2341 return view_->PreferredReadbackFormat(); | 2351 return view_->PreferredReadbackFormat(); |
| 2342 return SkBitmap::kARGB_8888_Config; | 2352 return SkBitmap::kARGB_8888_Config; |
| 2343 } | 2353 } |
| 2344 | 2354 |
| 2345 } // namespace content | 2355 } // namespace content |
| OLD | NEW |