chromium/cc/paint/paint_image.h

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_PAINT_PAINT_IMAGE_H_
#define CC_PAINT_PAINT_IMAGE_H_

#include <optional>
#include <string>
#include <vector>

#include "base/gtest_prod_util.h"
#include "base/memory/scoped_refptr.h"
#include "cc/paint/frame_metadata.h"
#include "cc/paint/image_animation_count.h"
#include "cc/paint/paint_export.h"
#include "cc/paint/paint_record.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkYUVAPixmaps.h"
#include "third_party/skia/include/private/SkGainmapInfo.h"
#include "ui/gfx/display_color_spaces.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/hdr_metadata.h"

class SkBitmap;
class SkColorSpace;
struct SkISize;

namespace blink {
class VideoFrame;
}

namespace cc {

class PaintImageGenerator;
class PaintWorkletInput;
class TextureBacking;

enum class ImageType {};

// An encoded image may include several auxiliary images within it. This enum
// is used to index those images. Auxiliary images can have different sizes and
// pixel formats from the default image.
enum class AuxImage : size_t {};

static constexpr std::array<AuxImage, 2> kAllAuxImages =;
constexpr size_t AuxImageIndex(AuxImage aux_image) {}
static constexpr size_t kAuxImageCount =;
static constexpr size_t kAuxImageIndexDefault =;
static constexpr size_t kAuxImageIndexGainmap =;
constexpr const char* AuxImageName(AuxImage aux_image) {}

enum class YUVSubsampling {};

enum class YUVIndex {};

// Should match the number of YUVIndex values.
static constexpr int kNumYUVPlanes =;

struct CC_PAINT_EXPORT ImageHeaderMetadata {};

// A representation of an image for the compositor.  This is the most abstract
// form of images, and represents what is known at paint time.  Note that aside
// from default construction, it can only be constructed using a
// PaintImageBuilder, or copied/moved into using operator=.  PaintImage can
// be backed by different kinds of content, such as a lazy generator, a paint
// record, a bitmap, or a texture.
//
// If backed by a generator, this image may not be decoded and information like
// the animation frame, the target colorspace, or the scale at which it will be
// used are not known yet.  A DrawImage is a PaintImage with those decisions
// known but that might not have been decoded yet.  A DecodedDrawImage is a
// DrawImage that has been decoded/scaled/uploaded with all of those parameters
// applied.
//
// The PaintImage -> DrawImage -> DecodedDrawImage -> PaintImage (via SkImage)
// path can be used to create a PaintImage that is snapshotted at a particular
// scale or animation frame.
class CC_PAINT_EXPORT PaintImage {};

}  // namespace cc

#endif  // CC_PAINT_PAINT_IMAGE_H_