flutter_flutter/testing/test_metal_surface_impl.h
Adlai Holler c57aff1800
Use the GrDirectContext factories instead of deprecated GrContext ones (#19962)
This is part of a larger effort to expose the difference between GrDirectContext,
which runs on the GPU thread and can directly perform operations like uploading
textures, and GrRecordingContext, which can only queue up work to be delivered
to the GrDirectContext later.
2020-07-28 13:32:09 -07:00

40 lines
992 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<GrDirectContext> context_;
sk_sp<SkSurface> surface_;
// |TestMetalSurface|
bool IsValid() const override;
// |TestMetalSurface|
sk_sp<GrDirectContext> 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_