OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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. | |
4 | |
5 #include "content/browser/renderer_host/offscreen_canvas_frame_receiver_impl.h" | |
6 | |
7 #include "base/bind_helpers.h" | |
8 #include "cc/surfaces/surface.h" | |
9 #include "cc/surfaces/surface_manager.h" | |
10 #include "content/browser/compositor/surface_utils.h" | |
11 #include "content/public/browser/browser_thread.h" | |
12 | |
13 namespace content { | |
14 | |
15 // static | |
16 void OffscreenCanvasFrameReceiverImpl::Create( | |
17 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasFrameReceiver> | |
18 request) { | |
19 // |binding_| will take ownership of OffscreenCanvasFrameReceiverImpl | |
20 new OffscreenCanvasFrameReceiverImpl(std::move(request)); | |
21 } | |
22 | |
23 OffscreenCanvasFrameReceiverImpl::OffscreenCanvasFrameReceiverImpl( | |
24 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasFrameReceiver> request) | |
25 : binding_(this, std::move(request)) {} | |
26 | |
27 OffscreenCanvasFrameReceiverImpl::~OffscreenCanvasFrameReceiverImpl() {} | |
28 | |
29 void OffscreenCanvasFrameReceiverImpl::SubmitCompositorFrame( | |
30 const cc::SurfaceId& surface_id, | |
31 cc::CompositorFrame frame) { | |
32 cc::Surface* surface = GetSurfaceManager()->GetSurfaceForId(surface_id); | |
33 if (!!surface) { | |
danakj
2016/09/02 19:12:42
you dont need !! for this
xlai (Olivia)
2016/09/02 20:10:06
Done.
| |
34 surface->QueueFrame(std::move(frame), base::Closure()); | |
35 } | |
36 // If surface doet not exist, drop the frame. | |
37 } | |
38 | |
39 } // namespace content | |
OLD | NEW |