1 // Copyright 2013 The Flutter 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 FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ 6 #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ 7 8 #include "flutter/fml/macros.h" 9 #include "flutter/fml/memory/weak_ptr.h" 10 #include "flutter/shell/common/surface.h" 11 #include "flutter/shell/gpu/gpu_surface_software_delegate.h" 12 13 namespace flutter { 14 15 class GPUSurfaceSoftware : public Surface { 16 public: 17 GPUSurfaceSoftware(GPUSurfaceSoftwareDelegate* delegate); 18 19 ~GPUSurfaceSoftware() override; 20 21 // |Surface| 22 bool IsValid() override; 23 24 // |Surface| 25 std::unique_ptr<SurfaceFrame> AcquireFrame(const SkISize& size) override; 26 27 // |Surface| 28 SkMatrix GetRootTransformation() const override; 29 30 // |Surface| 31 GrContext* GetContext() override; 32 33 // |Surface| 34 flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override; 35 36 private: 37 GPUSurfaceSoftwareDelegate* delegate_; 38 fml::WeakPtrFactory<GPUSurfaceSoftware> weak_factory_; 39 40 FML_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); 41 }; 42 43 } // namespace flutter 44 45 #endif // FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ 46