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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1640 | 1640 |
1641 void RenderWidgetHostImpl::OnPaintAtSizeAck(int tag, const gfx::Size& size) { | 1641 void RenderWidgetHostImpl::OnPaintAtSizeAck(int tag, const gfx::Size& size) { |
1642 std::pair<int, gfx::Size> details = std::make_pair(tag, size); | 1642 std::pair<int, gfx::Size> details = std::make_pair(tag, size); |
1643 NotificationService::current()->Notify( | 1643 NotificationService::current()->Notify( |
1644 NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, | 1644 NOTIFICATION_RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK, |
1645 Source<RenderWidgetHost>(this), | 1645 Source<RenderWidgetHost>(this), |
1646 Details<std::pair<int, gfx::Size> >(&details)); | 1646 Details<std::pair<int, gfx::Size> >(&details)); |
1647 } | 1647 } |
1648 | 1648 |
1649 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped( | 1649 void RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped( |
1650 int32 surface_id, | 1650 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params) { |
1651 uint64 surface_handle, | |
1652 int32 route_id, | |
1653 const gfx::Size& size, | |
1654 int32 gpu_process_host_id) { | |
1655 TRACE_EVENT0("renderer_host", | 1651 TRACE_EVENT0("renderer_host", |
1656 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); | 1652 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwapped"); |
1657 if (!view_) { | 1653 if (!view_) { |
1658 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 1654 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
1659 ack_params.sync_point = 0; | 1655 ack_params.sync_point = 0; |
1660 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1656 RenderWidgetHostImpl::AcknowledgeBufferPresent(params.route_id, |
1661 gpu_process_host_id, | 1657 params.gpu_process_host_id, |
1662 ack_params); | 1658 ack_params); |
1663 return; | 1659 return; |
1664 } | 1660 } |
1665 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; | 1661 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params gpu_params; |
1666 gpu_params.surface_id = surface_id; | 1662 gpu_params.surface_id = params.surface_id; |
1667 gpu_params.surface_handle = surface_handle; | 1663 gpu_params.surface_handle = params.surface_handle; |
1668 gpu_params.route_id = route_id; | 1664 gpu_params.route_id = params.route_id; |
1669 gpu_params.size = size; | 1665 gpu_params.size = params.size; |
1666 gpu_params.scale_factor = params.scale_factor; | |
Chris Evans
2013/05/22 22:30:30
This new parameter looks to come from the untruste
ccameron
2013/05/23 00:19:59
We scale gpu_params.size by 1/scale_factor, which
| |
1670 view_->AcceleratedSurfaceBuffersSwapped(gpu_params, | 1667 view_->AcceleratedSurfaceBuffersSwapped(gpu_params, |
1671 gpu_process_host_id); | 1668 params.gpu_process_host_id); |
1672 } | 1669 } |
1673 | 1670 |
1674 bool RenderWidgetHostImpl::OnSwapCompositorFrame( | 1671 bool RenderWidgetHostImpl::OnSwapCompositorFrame( |
1675 const IPC::Message& message) { | 1672 const IPC::Message& message) { |
1676 ViewHostMsg_SwapCompositorFrame::Param param; | 1673 ViewHostMsg_SwapCompositorFrame::Param param; |
1677 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) | 1674 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, ¶m)) |
1678 return false; | 1675 return false; |
1679 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); | 1676 scoped_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); |
1680 param.a.AssignTo(frame.get()); | 1677 param.a.AssignTo(frame.get()); |
1681 | 1678 |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2479 } | 2476 } |
2480 | 2477 |
2481 void RenderWidgetHostImpl::DetachDelegate() { | 2478 void RenderWidgetHostImpl::DetachDelegate() { |
2482 delegate_ = NULL; | 2479 delegate_ = NULL; |
2483 } | 2480 } |
2484 | 2481 |
2485 void RenderWidgetHostImpl::FrameSwapped(const cc::LatencyInfo& latency_info) { | 2482 void RenderWidgetHostImpl::FrameSwapped(const cc::LatencyInfo& latency_info) { |
2486 } | 2483 } |
2487 | 2484 |
2488 } // namespace content | 2485 } // namespace content |
OLD | NEW |