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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 bool RenderWidgetHostImpl::OnSwapCompositorFrame( | 1421 bool RenderWidgetHostImpl::OnSwapCompositorFrame( |
1422 const IPC::Message& message) { | 1422 const IPC::Message& message) { |
1423 // This trace event is used in | 1423 // This trace event is used in |
1424 // chrome/browser/extensions/api/cast_streaming/performance_test.cc | 1424 // chrome/browser/extensions/api/cast_streaming/performance_test.cc |
1425 TRACE_EVENT0("test_fps", | 1425 TRACE_EVENT0("test_fps", |
1426 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame")); | 1426 TRACE_DISABLED_BY_DEFAULT("OnSwapCompositorFrame")); |
1427 ViewHostMsg_SwapCompositorFrame::Param param; | 1427 ViewHostMsg_SwapCompositorFrame::Param param; |
1428 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) | 1428 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) |
1429 return false; | 1429 return false; |
1430 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 1430 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
1431 uint32 output_surface_id = param.a; | 1431 uint32 output_surface_id = get<0>(param); |
1432 param.b.AssignTo(frame.get()); | 1432 get<1>(param).AssignTo(frame.get()); |
1433 std::vector<IPC::Message> messages_to_deliver_with_frame; | 1433 std::vector<IPC::Message> messages_to_deliver_with_frame; |
1434 messages_to_deliver_with_frame.swap(param.c); | 1434 messages_to_deliver_with_frame.swap(get<2>(param)); |
1435 | 1435 |
1436 latency_tracker_.OnSwapCompositorFrame(&frame->metadata.latency_info); | 1436 latency_tracker_.OnSwapCompositorFrame(&frame->metadata.latency_info); |
1437 | 1437 |
1438 input_router_->OnViewUpdated( | 1438 input_router_->OnViewUpdated( |
1439 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata)); | 1439 GetInputRouterViewFlagsFromCompositorFrameMetadata(frame->metadata)); |
1440 | 1440 |
1441 if (view_) { | 1441 if (view_) { |
1442 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass()); | 1442 view_->OnSwapCompositorFrame(output_surface_id, frame.Pass()); |
1443 view_->DidReceiveRendererFrame(); | 1443 view_->DidReceiveRendererFrame(); |
1444 } else { | 1444 } else { |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 } | 2164 } |
2165 #endif | 2165 #endif |
2166 | 2166 |
2167 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2167 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2168 if (view_) | 2168 if (view_) |
2169 return view_->PreferredReadbackFormat(); | 2169 return view_->PreferredReadbackFormat(); |
2170 return kN32_SkColorType; | 2170 return kN32_SkColorType; |
2171 } | 2171 } |
2172 | 2172 |
2173 } // namespace content | 2173 } // namespace content |
OLD | NEW |