OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 SurfaceLayerBridge_h |
| 6 #define SurfaceLayerBridge_h |
| 7 |
| 8 #include <memory> |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "cc/surfaces/sequence_surface_reference_factory.h" |
| 12 #include "cc/surfaces/surface_id.h" |
| 13 #include "cc/surfaces/surface_reference_factory.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "platform/PlatformExport.h" |
| 16 #include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom
-blink.h" |
| 17 |
| 18 namespace blink { |
| 19 |
| 20 class SurfaceLayerBridge |
| 21 : public blink::mojom::blink::OffscreenCanvasSurfaceClient { |
| 22 public: |
| 23 SurfaceLayerBridge(); |
| 24 virtual ~SurfaceLayerBridge(); |
| 25 |
| 26 virtual void CreateSolidColorLayer() = 0; |
| 27 virtual void SatisfyCallback(const cc::SurfaceSequence&) = 0; |
| 28 virtual void RequireCallback(const cc::SurfaceId&, |
| 29 const cc::SurfaceSequence&) = 0; |
| 30 }; |
| 31 |
| 32 class SequenceSurfaceReferenceFactoryImpl |
| 33 : public cc::SequenceSurfaceReferenceFactory { |
| 34 public: |
| 35 SequenceSurfaceReferenceFactoryImpl(base::WeakPtr<SurfaceLayerBridge>); |
| 36 |
| 37 private: |
| 38 ~SequenceSurfaceReferenceFactoryImpl() override = default; |
| 39 |
| 40 // cc::SequenceSurfaceReferenceFactory implementation: |
| 41 void RequireSequence(const cc::SurfaceId&, |
| 42 const cc::SurfaceSequence&) const override; |
| 43 |
| 44 void SatisfySequence(const cc::SurfaceSequence&) const override; |
| 45 |
| 46 base::WeakPtr<SurfaceLayerBridge> bridge_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(SequenceSurfaceReferenceFactoryImpl); |
| 49 }; |
| 50 |
| 51 } // namespace blink |
| 52 |
| 53 #endif // SurfaceLayerBridge_h |
OLD | NEW |