Flutter Engine
test_metal_surface_impl.h
Go to the documentation of this file.
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_TESTING_TEST_METAL_SURFACE_IMPL_H_
6 #define FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
7 
8 #include "flutter/fml/macros.h"
9 #include "flutter/testing/test_metal_surface.h"
10 
11 namespace flutter {
12 
14  public:
15  TestMetalSurfaceImpl(SkISize surface_size);
16 
17  // |TestMetalSurface|
18  ~TestMetalSurfaceImpl() override;
19 
20  private:
21  bool is_valid_ = false;
22  sk_sp<GrDirectContext> context_;
23  sk_sp<SkSurface> surface_;
24 
25  // |TestMetalSurface|
26  bool IsValid() const override;
27 
28  // |TestMetalSurface|
29  sk_sp<GrDirectContext> GetGrContext() const override;
30 
31  // |TestMetalSurface|
32  sk_sp<SkSurface> GetSurface() const override;
33 
34  FML_DISALLOW_COPY_AND_ASSIGN(TestMetalSurfaceImpl);
35 };
36 
37 } // namespace flutter
38 
39 #endif // FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
TestMetalSurfaceImpl(SkISize surface_size)
Creates a MTLTexture backed SkSurface and context that can be used to render to in unit-tests...