Flutter Engine
The Flutter Engine
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 "flutter/impeller/golden_tests/screenshot.h"
9
10#include <CoreFoundation/CoreFoundation.h>
11#include <CoreImage/CoreImage.h>
12#include <string>
13
14namespace impeller {
15namespace testing {
16
17/// A screenshot that was produced from `MetalScreenshotter`.
19 public:
20 explicit MetalScreenshot(CGImageRef cgImage);
21
23
24 const uint8_t* GetBytes() const override;
25
26 size_t GetHeight() const override;
27
28 size_t GetWidth() const override;
29
30 size_t GetBytesPerRow() const override;
31
32 bool WriteToPNG(const std::string& path) const override;
33
34 private:
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_
A screenshot that was produced from MetalScreenshotter.
const uint8_t * GetBytes() const override
Access raw data of the screenshot.
bool WriteToPNG(const std::string &path) const override
size_t GetHeight() const override
Returns the height of the image in pixels.
size_t GetWidth() const override
Returns the width of the image in pixels.
size_t GetBytesPerRow() const override
Returns number of bytes required to represent one row of the raw image.
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57