Flutter Engine
 
Loading...
Searching...
No Matches
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
11
12#include "third_party/skia/include/core/SkSurface.h"
13
14namespace flutter::testing {
15
17 public:
18 TestMetalSurfaceImpl(const TestMetalContext& test_metal_context,
19 const DlISize& surface_size);
20
21 TestMetalSurfaceImpl(const TestMetalContext& test_metal_context,
22 int64_t texture_id,
23 const DlISize& surface_size);
24
25 // |TestMetalSurface|
27
28 private:
29 void Init(const TestMetalContext::TextureInfo& texture_info,
30 const DlISize& surface_size);
31
32 const TestMetalContext& test_metal_context_;
33 bool is_valid_ = false;
34 sk_sp<SkSurface> surface_;
36
37 // |TestMetalSurface|
38 bool IsValid() const override;
39
40 // |TestMetalSurface|
41 sk_sp<GrDirectContext> GetGrContext() const override;
42
43 // |TestMetalSurface|
44 sk_sp<SkSurface> GetSurface() const override;
45
46 // |TestMetalSurface|
47 sk_sp<SkImage> GetRasterSurfaceSnapshot() override;
48
49 // |TestMetalSurface|
50 TestMetalContext::TextureInfo GetTextureInfo() override;
51
53};
54
55} // namespace flutter::testing
56
57#endif // FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
Creates a MTLTexture backed SkSurface and context that can be used to render to in unit-tests.
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
int64_t texture_id