Flutter Engine
The 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
8#include "flutter/fml/macros.h"
9#include "flutter/testing/test_metal_context.h"
10#include "flutter/testing/test_metal_surface.h"
11
13
14namespace flutter {
15
17 public:
18 TestMetalSurfaceImpl(const TestMetalContext& test_metal_context,
19 const SkISize& surface_size);
20
21 TestMetalSurfaceImpl(const TestMetalContext& test_metal_context,
22 int64_t texture_id,
23 const SkISize& surface_size);
24
25 // |TestMetalSurface|
27
28 private:
29 void Init(const TestMetalContext::TextureInfo& texture_info,
30 const SkISize& 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|
48
49 // |TestMetalSurface|
51
53};
54
55} // namespace flutter
56
57#endif // FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_
sk_sp< SkImage > GetRasterSurfaceSnapshot() override
sk_sp< SkSurface > GetSurface() const override
sk_sp< GrDirectContext > GetGrContext() const override
TestMetalContext::TextureInfo GetTextureInfo() override
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
void Init()
int64_t texture_id