forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_metal_surface_impl.h
55 lines (39 loc) · 1.57 KB
/
test_metal_surface_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
#define FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
#include "flutter/fml/macros.h"
#include "flutter/testing/test_metal_context.h"
#include "flutter/testing/test_metal_surface.h"
namespace flutter {
class TestMetalSurfaceImpl : public TestMetalSurface {
public:
TestMetalSurfaceImpl(const TestMetalContext& test_metal_context,
const SkISize& surface_size);
TestMetalSurfaceImpl(const TestMetalContext& test_metal_context,
int64_t texture_id,
const SkISize& surface_size);
// |TestMetalSurface|
~TestMetalSurfaceImpl() override;
private:
void Init(const TestMetalContext::TextureInfo& texture_info,
const SkISize& surface_size);
const TestMetalContext& test_metal_context_;
bool is_valid_ = false;
sk_sp<SkSurface> surface_;
TestMetalContext::TextureInfo texture_info_;
// |TestMetalSurface|
bool IsValid() const override;
// |TestMetalSurface|
sk_sp<GrDirectContext> GetGrContext() const override;
// |TestMetalSurface|
sk_sp<SkSurface> GetSurface() const override;
// |TestMetalSurface|
sk_sp<SkImage> GetRasterSurfaceSnapshot() override;
// |TestMetalSurface|
TestMetalContext::TextureInfo GetTextureInfo() override;
FML_DISALLOW_COPY_AND_ASSIGN(TestMetalSurfaceImpl);
};
} // namespace flutter
#endif // FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_