| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ | |
| 7 | |
| 8 #include "cc/surfaces/surface_factory.h" | |
| 9 #include "cc/surfaces/surface_factory_client.h" | |
| 10 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c
anvas_surface.mojom.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 class OffscreenCanvasFrameReceiverImpl | |
| 15 : public blink::mojom::OffscreenCanvasFrameReceiver, | |
| 16 public cc::SurfaceFactoryClient { | |
| 17 public: | |
| 18 OffscreenCanvasFrameReceiverImpl(); | |
| 19 ~OffscreenCanvasFrameReceiverImpl() override; | |
| 20 | |
| 21 static void Create(blink::mojom::OffscreenCanvasFrameReceiverRequest request); | |
| 22 | |
| 23 void SubmitCompositorFrame(const cc::SurfaceId& surface_id, | |
| 24 cc::CompositorFrame frame) override; | |
| 25 | |
| 26 // cc::SurfaceFactoryClient implementation. | |
| 27 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | |
| 28 void WillDrawSurface(const cc::SurfaceId& id, | |
| 29 const gfx::Rect& damage_rect) override; | |
| 30 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | |
| 31 | |
| 32 private: | |
| 33 cc::SurfaceId surface_id_; | |
| 34 std::unique_ptr<cc::SurfaceFactory> surface_factory_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasFrameReceiverImpl); | |
| 37 }; | |
| 38 | |
| 39 } // namespace content | |
| 40 | |
| 41 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_FRAME_RECEIVER_IMPL_H_ | |
| OLD | NEW |