Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: content/browser/renderer_host/offscreen_canvas_surface_service_impl.h

Issue 2036663003: Establish mojo service between Canvas (blink) and SurfaceManager (browser) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN build in android_dbg_recipe Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_SURFACE_SERVICE_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_SERVICE_IMPL_H_
7
8 #include "cc/surfaces/surface_factory.h"
9 #include "cc/surfaces/surface_factory_client.h"
10 #include "cc/surfaces/surface_id.h"
11 #include "cc/surfaces/surface_id_allocator.h"
12 #include "mojo/public/cpp/bindings/interface_request.h"
13 #include "mojo/public/cpp/bindings/string.h"
14 #include "mojo/public/cpp/bindings/strong_binding.h"
15 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c anvas_surface_service.mojom.h"
16
17 namespace content {
18
19 class OffscreenCanvasSurfaceServiceImpl
20 : public blink::mojom::OffscreenCanvasSurfaceService,
21 public cc::SurfaceFactoryClient {
22 public:
23 static void Create(mojo::InterfaceRequest<
24 blink::mojom::OffscreenCanvasSurfaceService> request);
25
26 // blink::mojom::OffscreenCanvasSurfaceService implementation.
27 void GetSurfaceId(const GetSurfaceIdCallback& callback) override;
28 void RequestSurfaceCreation(const cc::SurfaceId& surface_id) override;
29 void Require(const cc::SurfaceId& surface_id,
30 const cc::SurfaceSequence& sequence) override;
31 void Satisfy(const cc::SurfaceSequence& sequence) override;
32
33 // cc::SurfaceFactoryClient implementation.
34 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
35 void WillDrawSurface(cc::SurfaceId id, const gfx::Rect& damage_rect) override;
36 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
37
38 private:
39 ~OffscreenCanvasSurfaceServiceImpl() override;
40 explicit OffscreenCanvasSurfaceServiceImpl(
41 mojo::InterfaceRequest<blink::mojom::OffscreenCanvasSurfaceService>
42 request);
43
44 // Surface-related state
45 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_;
46 std::unique_ptr<cc::SurfaceFactory> surface_factory_;
47
48 mojo::StrongBinding<blink::mojom::OffscreenCanvasSurfaceService> binding_;
49
50 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceServiceImpl);
51 };
52
53 } // namespace content
54
55 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_SERVICE_IMPL_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698