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
3 // found in the LICENSE file.
5 #include "content/browser/aura/software_browser_compositor_output_surface.h"
7 #include "base/message_loop/message_loop.h"
8 #include "base/time/time.h"
9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/software_output_device.h"
11 #include "content/browser/renderer_host/render_widget_host_impl.h"
12 #include "ui/events/latency_info.h"
16 SoftwareBrowserCompositorOutputSurface::SoftwareBrowserCompositorOutputSurface(
17 scoped_ptr<cc::SoftwareOutputDevice> software_device)
18 : cc::OutputSurface(software_device.Pass()) {}
20 void SoftwareBrowserCompositorOutputSurface::SwapBuffers(
21 cc::CompositorFrame* frame) {
22 ui::LatencyInfo latency_info = frame->metadata.latency_info;
23 latency_info.AddLatencyNumber(
24 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0);
26 base::MessageLoop::current()->PostTask(
29 &RenderWidgetHostImpl::CompositorFrameDrawn,
33 } // namespace content