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 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1537 void RenderWidgetHostImpl::OnRequestMove(const gfx::Rect& pos) { | 1537 void RenderWidgetHostImpl::OnRequestMove(const gfx::Rect& pos) { |
| 1538 if (view_) { | 1538 if (view_) { |
| 1539 view_->SetBounds(pos); | 1539 view_->SetBounds(pos); |
| 1540 Send(new ViewMsg_Move_ACK(routing_id_)); | 1540 Send(new ViewMsg_Move_ACK(routing_id_)); |
| 1541 } | 1541 } |
| 1542 } | 1542 } |
| 1543 | 1543 |
| 1544 #if defined(OS_MACOSX) | 1544 #if defined(OS_MACOSX) |
| 1545 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped( | 1545 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped( |
| 1546 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) { | 1546 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) { |
| 1547 // This trace event is used in | |
| 1548 // chrome/browser/extensions/api/cast_streaming/performance_test.cc | |
|
piman
2014/04/08 22:46:03
mmh, I think I would prefer if we added separate U
hubbe
2014/04/08 22:58:29
Done.
| |
| 1547 TRACE_EVENT0("renderer_host", | 1549 TRACE_EVENT0("renderer_host", |
| 1548 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); | 1550 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); |
| 1549 if (!ui::LatencyInfo::Verify(params.latency_info, | 1551 if (!ui::LatencyInfo::Verify(params.latency_info, |
| 1550 "ViewHostMsg_CompositorSurfaceBuffersSwapped")) | 1552 "ViewHostMsg_CompositorSurfaceBuffersSwapped")) |
| 1551 return; | 1553 return; |
| 1552 if (!view_) { | 1554 if (!view_) { |
| 1553 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1555 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
| 1554 ack_params.sync_point = 0; | 1556 ack_params.sync_point = 0; |
| 1555 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id, | 1557 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id, |
| 1556 params.gpu_process_host_id, | 1558 params.gpu_process_host_id, |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1567 for (size_t i = 0; i < gpu_params.latency_info.size(); i++) | 1569 for (size_t i = 0; i < gpu_params.latency_info.size(); i++) |
| 1568 AddLatencyInfoComponentIds(&gpu_params.latency_info[i]); | 1570 AddLatencyInfoComponentIds(&gpu_params.latency_info[i]); |
| 1569 view_->AcceleratedSurfaceBuffersSwapped(gpu_params, | 1571 view_->AcceleratedSurfaceBuffersSwapped(gpu_params, |
| 1570 params.gpu_process_host_id); | 1572 params.gpu_process_host_id); |
| 1571 view_->DidReceiveRendererFrame(); | 1573 view_->DidReceiveRendererFrame(); |
| 1572 } | 1574 } |
| 1573 #endif // OS_MACOSX | 1575 #endif // OS_MACOSX |
| 1574 | 1576 |
| 1575 bool RenderWidgetHostImpl::OnSwapCompositorFrame( | 1577 bool RenderWidgetHostImpl::OnSwapCompositorFrame( |
| 1576 const IPC::Message& message) { | 1578 const IPC::Message& message) { |
| 1579 // This trace event is used in | |
| 1580 // chrome/browser/extensions/api/cast_streaming/performance_test.cc | |
| 1581 TRACE_EVENT0("renderer_host", | |
| 1582 "RenderWidgetHostImpl::OnSwapCompositorFrame"); | |
| 1577 ViewHostMsg_SwapCompositorFrame::Param param; | 1583 ViewHostMsg_SwapCompositorFrame::Param param; |
| 1578 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) | 1584 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) |
| 1579 return false; | 1585 return false; |
| 1580 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 1586 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
| 1581 uint32 output_surface_id = param.a; | 1587 uint32 output_surface_id = param.a; |
| 1582 param.b.AssignTo(frame.get()); | 1588 param.b.AssignTo(frame.get()); |
| 1583 | 1589 |
| 1584 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) | 1590 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) |
| 1585 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]); | 1591 AddLatencyInfoComponentIds(&frame->metadata.latency_info[i]); |
| 1586 | 1592 |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2552 } | 2558 } |
| 2553 } | 2559 } |
| 2554 | 2560 |
| 2555 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2561 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2556 if (view_) | 2562 if (view_) |
| 2557 return view_->PreferredReadbackFormat(); | 2563 return view_->PreferredReadbackFormat(); |
| 2558 return SkBitmap::kARGB_8888_Config; | 2564 return SkBitmap::kARGB_8888_Config; |
| 2559 } | 2565 } |
| 2560 | 2566 |
| 2561 } // namespace content | 2567 } // namespace content |
| OLD | NEW |