| OLD | NEW |
| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| 11 #include "cc/surfaces/surface_id.h" | |
| 12 #include "cc/surfaces/surface_info.h" | 11 #include "cc/surfaces/surface_info.h" |
| 13 #include "cc/surfaces/surface_reference_base.h" | |
| 14 #include "cc/surfaces/surface_reference_factory.h" | 12 #include "cc/surfaces/surface_reference_factory.h" |
| 15 #include "cc/surfaces/surface_sequence.h" | |
| 16 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 17 | 14 |
| 18 namespace cc { | 15 namespace cc { |
| 19 | 16 |
| 20 // A layer that renders a surface referencing the output of another compositor | 17 // A layer that renders a surface referencing the output of another compositor |
| 21 // instance or client. | 18 // instance or client. |
| 22 class CC_EXPORT SurfaceLayer : public Layer { | 19 class CC_EXPORT SurfaceLayer : public Layer { |
| 23 public: | 20 public: |
| 24 static scoped_refptr<SurfaceLayer> Create( | 21 static scoped_refptr<SurfaceLayer> Create( |
| 25 scoped_refptr<SurfaceReferenceFactory> ref_factory); | 22 scoped_refptr<SurfaceReferenceFactory> ref_factory); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 protected: | 40 protected: |
| 44 explicit SurfaceLayer(scoped_refptr<SurfaceReferenceFactory> ref_factory); | 41 explicit SurfaceLayer(scoped_refptr<SurfaceReferenceFactory> ref_factory); |
| 45 bool HasDrawableContent() const override; | 42 bool HasDrawableContent() const override; |
| 46 | 43 |
| 47 private: | 44 private: |
| 48 ~SurfaceLayer() override; | 45 ~SurfaceLayer() override; |
| 49 void RemoveCurrentReference(); | 46 void RemoveCurrentReference(); |
| 50 | 47 |
| 51 SurfaceInfo surface_info_; | 48 SurfaceInfo surface_info_; |
| 52 scoped_refptr<SurfaceReferenceFactory> ref_factory_; | 49 scoped_refptr<SurfaceReferenceFactory> ref_factory_; |
| 53 std::unique_ptr<SurfaceReferenceBase> current_ref_; | 50 base::Closure reference_returner_; |
| 54 bool stretch_content_to_fill_bounds_ = false; | 51 bool stretch_content_to_fill_bounds_ = false; |
| 55 | 52 |
| 56 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); | 53 DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); |
| 57 }; | 54 }; |
| 58 | 55 |
| 59 } // namespace cc | 56 } // namespace cc |
| 60 | 57 |
| 61 #endif // CC_LAYERS_SURFACE_LAYER_H_ | 58 #endif // CC_LAYERS_SURFACE_LAYER_H_ |
| OLD | NEW |