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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1465 // This trace event is used in | 1465 // This trace event is used in |
| 1466 // chrome/browser/extensions/api/cast_streaming/performance_test.cc | 1466 // chrome/browser/extensions/api/cast_streaming/performance_test.cc |
| 1467 UNSHIPPED_TRACE_EVENT0("test_fps", | 1467 UNSHIPPED_TRACE_EVENT0("test_fps", |
| 1468 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame")); | 1468 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame")); |
| 1469 ViewHostMsg_SwapCompositorFrame::Param param; | 1469 ViewHostMsg_SwapCompositorFrame::Param param; |
| 1470 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) | 1470 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) |
| 1471 return false; | 1471 return false; |
| 1472 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 1472 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
| 1473 uint32 output_surface_id = param.a; | 1473 uint32 output_surface_id = param.a; |
| 1474 param.b.AssignTo(frame.get()); | 1474 param.b.AssignTo(frame.get()); |
| 1475 std::vector<IPC::Message> messages_to_deliver_with_frame; | |
| 1476 messages_to_deliver_with_frame.swap(param.c); | |
| 1477 | |
| 1478 for (std::vector<IPC::Message>::const_iterator i = | |
| 1479 messages_to_deliver_with_frame.begin(); | |
| 1480 i != messages_to_deliver_with_frame.end(); | |
| 1481 ++i) { | |
| 1482 GetProcess()->OnMessageReceived(*i); | |
| 1483 } | |
| 1484 messages_to_deliver_with_frame.clear(); | |
|
piman
2014/05/20 19:54:05
Do you need these to be delivered before the OnSwa
mkosiba (inactive)
2014/05/22 17:40:24
nope.
| |
| 1475 | 1485 |
| 1476 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) | 1486 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) |
| 1477 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]); | 1487 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]); |
| 1478 | 1488 |
| 1479 input_router_->OnViewUpdated( | 1489 input_router_->OnViewUpdated( |
| 1480 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata)); | 1490 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata)); |
| 1481 | 1491 |
| 1482 if (view_) { | 1492 if (view_) { |
| 1483 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass()); | 1493 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass()); |
| 1484 view_->DidReceiveRendererFrame(); | 1494 view_->DidReceiveRendererFrame(); |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2320 } | 2330 } |
| 2321 } | 2331 } |
| 2322 | 2332 |
| 2323 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2333 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2324 if (view_) | 2334 if (view_) |
| 2325 return view_->PreferredReadbackFormat(); | 2335 return view_->PreferredReadbackFormat(); |
| 2326 return SkBitmap::kARGB_8888_Config; | 2336 return SkBitmap::kARGB_8888_Config; |
| 2327 } | 2337 } |
| 2328 | 2338 |
| 2329 } // namespace content | 2339 } // namespace content |
| OLD | NEW |