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

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

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)
Patch Set: Furnish Created 4 years 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_
7 7
8 #include "cc/surfaces/surface_id.h" 8 #include "cc/surfaces/surface_id.h"
9 #include "cc/surfaces/surface_id_allocator.h" 9 #include "cc/surfaces/surface_id_allocator.h"
10 #include "mojo/public/cpp/bindings/interface_request.h" 10 #include "mojo/public/cpp/bindings/interface_request.h"
11 #include "mojo/public/cpp/bindings/string.h" 11 #include "mojo/public/cpp/bindings/string.h"
12 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c anvas_surface.mojom.h" 12 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_c anvas_surface.mojom.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class CONTENT_EXPORT OffscreenCanvasSurfaceImpl 16 class CONTENT_EXPORT OffscreenCanvasSurfaceImpl
17 : public blink::mojom::OffscreenCanvasSurface { 17 : public blink::mojom::OffscreenCanvasSurface {
18 public: 18 public:
19 OffscreenCanvasSurfaceImpl(); 19 OffscreenCanvasSurfaceImpl();
20 ~OffscreenCanvasSurfaceImpl() override; 20 ~OffscreenCanvasSurfaceImpl() override;
21 21
22 static void Create(blink::mojom::OffscreenCanvasSurfaceRequest request); 22 static void Create(blink::mojom::OffscreenCanvasSurfaceRequest request);
23 23
24 void OnSurfaceCreated(const cc::SurfaceId& surface_id,
25 const gfx::Size& frame_size,
26 float device_scale_factor);
27
24 // blink::mojom::OffscreenCanvasSurface implementation. 28 // blink::mojom::OffscreenCanvasSurface implementation.
25 void GetSurfaceId(GetSurfaceIdCallback callback) override; 29 void SetClient(blink::mojom::OffscreenCanvasSurfaceClientPtr,
30 const cc::FrameSinkId&) override;
26 void Require(const cc::SurfaceId& surface_id, 31 void Require(const cc::SurfaceId& surface_id,
27 const cc::SurfaceSequence& sequence) override; 32 const cc::SurfaceSequence& sequence) override;
28 void Satisfy(const cc::SurfaceSequence& sequence) override; 33 void Satisfy(const cc::SurfaceSequence& sequence) override;
29 34
30 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } 35 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; }
31 36
32 private: 37 private:
38 blink::mojom::OffscreenCanvasSurfaceClientPtr client_;
39
33 // Surface-related state 40 // Surface-related state
34 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_;
35 cc::FrameSinkId frame_sink_id_; 41 cc::FrameSinkId frame_sink_id_;
42 cc::LocalFrameId current_local_frame_id_;
36 43
37 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl); 44 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl);
38 }; 45 };
39 46
40 } // namespace content 47 } // namespace content
41 48
42 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ 49 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698