blob: 30253989801de5ad07ac7c4f76649bedf37166ab [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <CoreFoundation/CoreFoundation.h>
#include <CoreImage/CoreImage.h>
#include <string>
#include "flutter/fml/macros.h"
namespace impeller {
namespace testing {
class MetalScreenshoter;
/// A screenshot that was produced from `MetalScreenshoter`.
class MetalScreenshot {
public:
~MetalScreenshot();
const UInt8* GetBytes() const;
size_t GetHeight() const;
size_t GetWidth() const;
bool WriteToPNG(const std::string& path) const;
private:
friend class MetalScreenshoter;
explicit MetalScreenshot(CGImageRef cgImage);
FML_DISALLOW_COPY_AND_ASSIGN(MetalScreenshot);
CGImageRef cg_image_;
CFDataRef pixel_data_;
};
} // namespace testing
} // namespace impeller