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 cc { |
| 19 class Layer; |
| 20 class SurfaceInfo; |
| 21 } // namespace cc |
| 22 |
| 23 namespace blink { |
| 24 |
| 25 class WebLayer; |
| 26 class WebLayerTreeView; |
| 27 |
| 28 class SurfaceLayerBridge |
| 29 : public blink::mojom::blink::OffscreenCanvasSurfaceClient { |
| 30 public: |
| 31 SurfaceLayerBridge(); |
| 32 virtual ~SurfaceLayerBridge(); |
| 33 |
| 34 virtual void CreateSolidColorLayer() = 0; |
| 35 virtual void SatisfyCallback(const cc::SurfaceSequence&) = 0; |
| 36 virtual void RequireCallback(const cc::SurfaceId&, |
| 37 const cc::SurfaceSequence&) = 0; |
| 38 }; |
| 39 |
| 40 class SequenceSurfaceReferenceFactoryImpl |
| 41 : public cc::SequenceSurfaceReferenceFactory { |
| 42 public: |
| 43 SequenceSurfaceReferenceFactoryImpl(base::WeakPtr<SurfaceLayerBridge> bridge); |
| 44 |
| 45 private: |
| 46 ~SequenceSurfaceReferenceFactoryImpl() override = default; |
| 47 |
| 48 // cc::SequenceSurfaceReferenceFactory implementation: |
| 49 void RequireSequence(const cc::SurfaceId& id, |
| 50 const cc::SurfaceSequence& sequence) const override; |
| 51 |
| 52 void SatisfySequence(const cc::SurfaceSequence& sequence) const override; |
| 53 |
| 54 base::WeakPtr<SurfaceLayerBridge> bridge_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(SequenceSurfaceReferenceFactoryImpl); |
| 57 }; |
| 58 |
| 59 } // namespace blink |
| 60 |
| 61 #endif // SurfaceLayerBridge_h |
OLD | NEW |