| Flutter Impeller |

metal_screenshot.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 #pragma once
6
7 #include <CoreFoundation/CoreFoundation.h>
8 #include <CoreImage/CoreImage.h>
9 #include <string>
10
11 #include "flutter/fml/macros.h"
12
13 namespace impeller {
14 namespace testing {
15
16 class MetalScreenshoter;
17
18 /// A screenshot that was produced from `MetalScreenshoter`.
19 class MetalScreenshot {
20 public:
21 ~MetalScreenshot();
22
23 const UInt8* GetBytes() const;
24
25 size_t GetHeight() const;
26
27 size_t GetWidth() const;
28
29 bool WriteToPNG(const std::string& path) const;
30
31 private:
32 friend class MetalScreenshoter;
33 explicit MetalScreenshot(CGImageRef cgImage);
34 FML_DISALLOW_COPY_AND_ASSIGN(MetalScreenshot);
35 CGImageRef cg_image_;
36 CFDataRef pixel_data_;
37 };
38 } // namespace testing
39 } // namespace impeller
impeller::testing::MetalScreenshot
A screenshot that was produced from MetalScreenshoter.
Definition: metal_screenshot.h:19
impeller::testing::MetalScreenshot::GetWidth
size_t GetWidth() const
Definition: metal_screenshot.mm:28
impeller::testing::MetalScreenshot::~MetalScreenshot
~MetalScreenshot()
Definition: metal_screenshot.mm:15
impeller::testing::MetalScreenshoter
Converts Pictures to MetalScreenshots with the playground backend.
Definition: metal_screenshoter.h:16
impeller::testing::MetalScreenshot::GetHeight
size_t GetHeight() const
Definition: metal_screenshot.mm:24
impeller::testing::MetalScreenshot::GetBytes
const UInt8 * GetBytes() const
Definition: metal_screenshot.mm:20
impeller
Definition: aiks_context.cc:10
impeller::testing::MetalScreenshot::WriteToPNG
bool WriteToPNG(const std::string &path) const
Definition: metal_screenshot.mm:32