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

Side by Side Diff: cc/layers/surface_layer.h

Issue 666163006: Allow layers to signal that additional sequences are needed before surface destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CC_LAYERS_SURFACE_LAYER_H_ 5 #ifndef CC_LAYERS_SURFACE_LAYER_H_
6 #define CC_LAYERS_SURFACE_LAYER_H_ 6 #define CC_LAYERS_SURFACE_LAYER_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/layers/surface_holder.h"
10 #include "cc/surfaces/surface_id.h" 11 #include "cc/surfaces/surface_id.h"
11 12
12 namespace cc { 13 namespace cc {
14 class SatisfySwapPromise;
13 15
14 // A layer that renders a surface referencing the output of another compositor 16 // A layer that renders a surface referencing the output of another compositor
15 // instance or client. 17 // instance or client.
16 class CC_EXPORT SurfaceLayer : public Layer { 18 class CC_EXPORT SurfaceLayer : public Layer {
17 public: 19 public:
18 static scoped_refptr<SurfaceLayer> Create(); 20 static scoped_refptr<SurfaceLayer> Create();
19 21
20 void SetSurfaceId(SurfaceId surface_id); 22 void SetSurfaceId(scoped_refptr<SurfaceHolder> surface_holder);
piman 2014/11/03 23:49:26 nit: SetSurfaceHolder?
21 23
22 // Layer overrides. 24 // Layer overrides.
23 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 25 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
26 void SetLayerTreeHost(LayerTreeHost* host) override;
24 void PushPropertiesTo(LayerImpl* layer) override; 27 void PushPropertiesTo(LayerImpl* layer) override;
25 28
26 protected: 29 protected:
27 SurfaceLayer(); 30 SurfaceLayer();
28 bool HasDrawableContent() const override; 31 bool HasDrawableContent() const override;
29 32
30 private: 33 private:
31 ~SurfaceLayer() override; 34 ~SurfaceLayer() override;
35 void CreateNewDestroySequence();
36 void SatisfyDestroySequence();
32 37
33 SurfaceId surface_id_; 38 scoped_refptr<SurfaceHolder> surface_holder_;
39 SurfaceSequence destroy_sequence_;
40 base::WeakPtr<SatisfySwapPromise> last_swap_promise_;
34 41
35 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); 42 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer);
36 }; 43 };
37 44
38 } // namespace cc 45 } // namespace cc
39 46
40 #endif // CC_LAYERS_SURFACE_LAYER_H_ 47 #endif // CC_LAYERS_SURFACE_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698