| OLD | NEW |
| 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 // blink::mojom::OffscreenCanvasSurface implementation. | 24 // blink::mojom::OffscreenCanvasSurface implementation. |
| 25 void GetSurfaceId(GetSurfaceIdCallback callback) override; | 25 void GetSurfaceId(blink::mojom::OffscreenCanvasSurfaceClientPtr client, |
| 26 GetSurfaceIdCallback callback) override; |
| 26 void Require(const cc::SurfaceId& surface_id, | 27 void Require(const cc::SurfaceId& surface_id, |
| 27 const cc::SurfaceSequence& sequence) override; | 28 const cc::SurfaceSequence& sequence) override; |
| 28 void Satisfy(const cc::SurfaceSequence& sequence) override; | 29 void Satisfy(const cc::SurfaceSequence& sequence) override; |
| 29 | 30 |
| 30 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } | 31 const cc::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } |
| 32 cc::LocalFrameId GenerateLocalFrameId() { |
| 33 return id_allocator_->GenerateId(); |
| 34 } |
| 35 |
| 36 void OnSurfaceSizeChanged(const cc::SurfaceId& new_surface_id, |
| 37 gfx::Size new_surface_size); |
| 31 | 38 |
| 32 private: | 39 private: |
| 33 // Surface-related state | 40 // Surface-related state |
| 34 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; | 41 std::unique_ptr<cc::SurfaceIdAllocator> id_allocator_; |
| 35 cc::FrameSinkId frame_sink_id_; | 42 cc::FrameSinkId frame_sink_id_; |
| 36 | 43 |
| 44 blink::mojom::OffscreenCanvasSurfaceClientPtr client_; |
| 45 |
| 37 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl); | 46 DISALLOW_COPY_AND_ASSIGN(OffscreenCanvasSurfaceImpl); |
| 38 }; | 47 }; |
| 39 | 48 |
| 40 } // namespace content | 49 } // namespace content |
| 41 | 50 |
| 42 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ | 51 #endif // CONTENT_BROWSER_RENDERER_HOST_OFFSCREEN_CANVAS_SURFACE_IMPL_H_ |
| OLD | NEW |