flutter_flutter/engine/src/flutter/testing/test_metal_surface_impl.h
Chinmay Garde 2866095b58 Setup a Metal test surface and add a new unit-test target that tests the testing utilities.
`//flutter/testing` now contains a lot of utilities used by other test targets.
This includes stuff like working with render targets that use either OpenGL or
Metal, fixtures for interacting with the Dart VM, test assertion predicates,
etc.. However, these utilities themselves are not tested as part of a standalone
test suite. Instead, only the test targets that include it exercise these
utilities. Since these are no longer trivial, a new test target has been added
that tests the testing utilities directly.
2019-11-22 23:03:34 -08:00

40 lines
980 B
C++

// 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_surface.h"
namespace flutter {
class TestMetalSurfaceImpl : public TestMetalSurface {
public:
TestMetalSurfaceImpl(SkISize surface_size);
// |TestMetalSurface|
~TestMetalSurfaceImpl() override;
private:
bool is_valid_ = false;
sk_sp<GrContext> context_;
sk_sp<SkSurface> surface_;
// |TestMetalSurface|
bool IsValid() const override;
// |TestMetalSurface|
sk_sp<GrContext> GetGrContext() const override;
// |TestMetalSurface|
sk_sp<SkSurface> GetSurface() const override;
FML_DISALLOW_COPY_AND_ASSIGN(TestMetalSurfaceImpl);
};
} // namespace flutter
#endif // FLUTTER_TESTING_TEST_METAL_SURFACE_IMPL_H_