Flutter Engine
The Flutter Engine
test_metal_surface.cc
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#include "flutter/testing/test_metal_surface.h"
6
7#include "flutter/fml/logging.h"
8#include "flutter/testing/test_metal_surface_impl.h"
9
11
12namespace flutter {
13
15 return true;
16}
17
18std::unique_ptr<TestMetalSurface> TestMetalSurface::Create(
19 const TestMetalContext& test_metal_context,
20 SkISize surface_size) {
21 return std::make_unique<TestMetalSurfaceImpl>(test_metal_context,
22 surface_size);
23}
24
25std::unique_ptr<TestMetalSurface> TestMetalSurface::Create(
26 const TestMetalContext& test_metal_context,
27 int64_t texture_id,
28 SkISize surface_size) {
29 return std::make_unique<TestMetalSurfaceImpl>(test_metal_context, texture_id,
30 surface_size);
31}
32
34
36
38 return impl_ ? impl_->IsValid() : false;
39}
40
42 return impl_ ? impl_->GetGrContext() : nullptr;
43}
44
46 return impl_ ? impl_->GetSurface() : nullptr;
47}
48
50 return impl_ ? impl_->GetRasterSurfaceSnapshot() : nullptr;
51}
52
54 return impl_ ? impl_->GetTextureInfo() : TestMetalContext::TextureInfo();
55}
56
57} // namespace flutter
virtual sk_sp< GrDirectContext > GetGrContext() const
static std::unique_ptr< TestMetalSurface > Create(const TestMetalContext &test_metal_context, SkISize surface_size=SkISize::MakeEmpty())
virtual bool IsValid() const
virtual sk_sp< SkImage > GetRasterSurfaceSnapshot()
virtual TestMetalContext::TextureInfo GetTextureInfo()
virtual sk_sp< SkSurface > GetSurface() const
Definition: SkSize.h:16
int64_t texture_id