Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/aura/software_browser_compositor_output_surface.h" | 5 #include "content/browser/aura/software_browser_compositor_output_surface.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 output_surface_map, | 28 output_surface_map, |
| 29 compositor_message_loop, | 29 compositor_message_loop, |
| 30 compositor), | 30 compositor), |
| 31 output_surface_proxy_(surface_proxy) {} | 31 output_surface_proxy_(surface_proxy) {} |
| 32 | 32 |
| 33 SoftwareBrowserCompositorOutputSurface:: | 33 SoftwareBrowserCompositorOutputSurface:: |
| 34 ~SoftwareBrowserCompositorOutputSurface() {} | 34 ~SoftwareBrowserCompositorOutputSurface() {} |
| 35 | 35 |
| 36 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( | 36 void SoftwareBrowserCompositorOutputSurface::SwapBuffers( |
| 37 cc::CompositorFrame* frame) { | 37 cc::CompositorFrame* frame) { |
| 38 ui::LatencyInfo latency_info = frame->metadata.latency_info; | 38 // TODO(miletus) : Convert RenderWidgetHostImpl::CompositorFrameDrawn() to |
| 39 latency_info.AddLatencyNumber( | 39 // take std::vector<ui::LatencyInfo> directly so we only post the task once. |
|
danakj
2013/12/20 19:27:37
One question here, should we merge the LatencyInfo
Yufeng Shen (Slow to review)
2013/12/20 19:36:32
It depends on what CompositorFrameDrawn() does wit
| |
| 40 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); | 40 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) { |
| 41 | 41 frame->metadata.latency_info[i].AddLatencyNumber( |
| 42 base::MessageLoop::current()->PostTask( | 42 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); |
| 43 FROM_HERE, | 43 base::MessageLoop::current()->PostTask( |
| 44 base::Bind( | 44 FROM_HERE, |
| 45 &RenderWidgetHostImpl::CompositorFrameDrawn, | 45 base::Bind( |
| 46 latency_info)); | 46 &RenderWidgetHostImpl::CompositorFrameDrawn, |
| 47 frame->metadata.latency_info[i])); | |
| 48 } | |
| 47 | 49 |
| 48 gfx::VSyncProvider* vsync_provider = software_device()->GetVSyncProvider(); | 50 gfx::VSyncProvider* vsync_provider = software_device()->GetVSyncProvider(); |
| 49 if (vsync_provider) { | 51 if (vsync_provider) { |
| 50 vsync_provider->GetVSyncParameters( | 52 vsync_provider->GetVSyncParameters( |
| 51 base::Bind(&BrowserCompositorOutputSurfaceProxy:: | 53 base::Bind(&BrowserCompositorOutputSurfaceProxy:: |
| 52 OnUpdateVSyncParametersOnCompositorThread, | 54 OnUpdateVSyncParametersOnCompositorThread, |
| 53 output_surface_proxy_, | 55 output_surface_proxy_, |
| 54 surface_id_)); | 56 surface_id_)); |
| 55 } | 57 } |
| 56 } | 58 } |
| 57 | 59 |
| 58 } // namespace content | 60 } // namespace content |
| OLD | NEW |