chromium/ui/gfx/buffer_types.h

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

#ifndef UI_GFX_BUFFER_TYPES_H_
#define UI_GFX_BUFFER_TYPES_H_

#include <stdint.h>

#include <tuple>

namespace gfx {

// The format needs to be taken into account when mapping a buffer into the
// client's address space.
enum class BufferFormat : uint8_t {};

// The usage mode affects how a buffer can be used. Only buffers created with
// *_CPU_READ_WRITE_* can be mapped into the client's address space and accessed
// by the CPU.
// *_VDA_WRITE is for cases where a video decode accelerator writes into the
// buffers.
// PROTECTED_* are for HW protected buffers that cannot be read by the CPU and
// can only be read in protected GPU contexts or scanned out to overlays.
// At present, SCANOUT implies GPU_READ_WRITE. This doesn't apply to other
// SCANOUT_* values.

// TODO(reveman): Add GPU_READ_WRITE for use-cases where SCANOUT is not
// required.
enum class BufferUsage {};

struct BufferUsageAndFormat {};

// Used to identify the plane of a GpuMemoryBuffer to use when creating a
// SharedImage.
enum class BufferPlane {};

}  // namespace gfx

#endif  // UI_GFX_BUFFER_TYPES_H_