Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
screenshotter.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
6
7namespace impeller {
8namespace testing {
9
10#ifndef FML_OS_MACOSX
11std::unique_ptr<Screenshot> Screenshotter::MakeMetalScreenshot(
12 std::shared_ptr<Context>& context,
13 const std::shared_ptr<Texture>& texture) {
14 FML_LOG(INFO) << "Screenshot not supported for Metal on this platform";
15 return nullptr;
16}
17
18std::unique_ptr<Screenshot> Screenshotter::MakeOpenGLScreenshot(
19 std::shared_ptr<Context>& context,
20 const std::shared_ptr<Texture>& texture) {
21 FML_LOG(INFO) << "Screenshot not supported for OpenGL on this platform";
22 return nullptr;
23}
24
25std::unique_ptr<Screenshot> Screenshotter::MakeVulkanScreenshot(
26 std::shared_ptr<Context>& context,
27 const std::shared_ptr<Texture>& texture) {
28 FML_LOG(INFO) << "Screenshot not supported for Vulkan on this platform";
29 return nullptr;
30}
31#endif // FML_OS_MACOSX
32
33std::unique_ptr<Screenshot> Screenshotter::MakeScreenshot(
34 std::shared_ptr<Context>& context,
35 const std::shared_ptr<Texture>& texture) {
36 if (!context || !texture) {
37 return nullptr;
38 }
39 switch (context->GetBackendType()) {
41 return MakeMetalScreenshot(context, texture);
42
44 return MakeOpenGLScreenshot(context, texture);
45
47 return MakeVulkanScreenshot(context, texture);
48 }
49}
50
51} // namespace testing
52} // namespace impeller
static std::unique_ptr< Screenshot > MakeScreenshot(std::shared_ptr< Context > &context, const std::shared_ptr< Texture > &texture)
#define FML_LOG(severity)
Definition logging.h:101
FlTexture * texture
std::shared_ptr< ContextGLES > context