| 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 #ifndef FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOT_H_
6 #define FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOT_H_
7
8 #include <CoreFoundation/CoreFoundation.h>
9 #include <CoreImage/CoreImage.h>
10 #include <string>
11
12 #include "flutter/fml/macros.h"
13
14 namespace impeller {
15 namespace testing {
16
17 /// A screenshot that was produced from `MetalScreenshotter`.
18 class MetalScreenshot {
19 public:
20 ~MetalScreenshot();
21
22 const UInt8* GetBytes() const;
23
24 size_t GetHeight() const;
25
26 size_t GetWidth() const;
27
28 size_t GetBytesPerRow() const;
29
30 bool WriteToPNG(const std::string& path) const;
31
32 private:
33 friend class MetalScreenshotter;
34 explicit MetalScreenshot(CGImageRef cgImage);
35 MetalScreenshot(const MetalScreenshot&) = delete;
36
37 MetalScreenshot& operator=(const MetalScreenshot&) = delete;
38 CGImageRef cg_image_;
39 CFDataRef pixel_data_;
40 };
41 } // namespace testing
42 } // namespace impeller
43
44 #endif // FLUTTER_IMPELLER_GOLDEN_TESTS_METAL_SCREENSHOT_H_
impeller::testing::MetalScreenshot
A screenshot that was produced from MetalScreenshotter.
Definition: metal_screenshot.h:18
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::MetalScreenshot::GetBytesPerRow
size_t GetBytesPerRow() const
Definition: metal_screenshot.mm:32
impeller::testing::MetalScreenshot::GetHeight
size_t GetHeight() const
Definition: metal_screenshot.mm:24
impeller::testing::MetalScreenshotter
Definition: metal_screenshotter.h:18
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:36