chromium/third_party/angle/src/image_util/LoadToNative_unittest.cpp

//
// Copyright 2023 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// LoadToNative_unittest.cpp: Unit tests for pixel loading functions.

#include <gmock/gmock.h>
#include <vector>
#include "common/debug.h"
#include "common/mathutil.h"
#include "image_util/loadimage.h"

usingnamespaceangle;
usingnamespacetesting;

namespace
{

template <typename Type>
void initializeRGBInput(std::vector<Type> &rgbInput,
                        size_t width,
                        size_t height,
                        size_t depth,
                        size_t inputPixelBytes,
                        size_t inputByteOffset,
                        size_t inputRowPitch,
                        size_t inputDepthPitch)
{}

template <typename Type, uint8_t fourthValue>
void verifyRGBToRGBAResults(const char *strCase,
                            std::vector<Type> &rgbInput,
                            std::vector<Type> &rgbaOutput,
                            size_t width,
                            size_t height,
                            size_t depth,
                            size_t inputPixelBytes,
                            size_t inputByteOffset,
                            size_t inputRowPitch,
                            size_t inputDepthPitch,
                            size_t outputPixelBytes,
                            size_t outputByteOffset,
                            size_t outputRowPitch,
                            size_t outputDepthPitch)
{}

template <uint8_t fourthValue>
void TestLoadUbyteRGBToRGBA(ImageLoadContext &context,
                            const char *strCase,
                            size_t width,
                            size_t height,
                            size_t depth,
                            size_t inputByteOffset,
                            size_t outputByteOffset,
                            size_t inputRowAlignment)
{}

template <uint8_t fourthValue>
void TestLoadSbyteRGBToRGBA(ImageLoadContext &context,
                            const char *strCase,
                            size_t width,
                            size_t height,
                            size_t depth,
                            size_t inputByteOffset,
                            size_t outputByteOffset,
                            size_t inputRowAlignment)
{}

void TestLoadByteRGBToRGBAForAllCases(ImageLoadContext &context,
                                      size_t inputCase,
                                      size_t width,
                                      size_t height,
                                      size_t depth,
                                      size_t inputByteOffset,
                                      size_t outputByteOffset,
                                      size_t inputRowAlignment)
{}

// Tests the ubyte (0xFF) RGB to RGBA loading function for one RGB pixel.
TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataOnePixelWithFourthCompOfFF)
{}

// Tests the ubyte (0x01) RGB to RGBA loading function for one RGB pixel.
TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataOnePixelWithFourthCompOf01)
{}

// Tests the sbyte (0x7F) RGB to RGBA loading function for one RGB pixel.
TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataOnePixelWithFourthCompOf7F)
{}

// Tests the sbyte (0x01) RGB to RGBA loading function for one RGB pixel.
TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataOnePixelWithFourthCompOf01)
{}

// Tests the ubyte (0xFF) RGB to RGBA loading function for 4 RGB pixels, which should be read
// together.
TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataFourPixelsWithFourthCompOfFF)
{}

// Tests the ubyte (0x01) RGB to RGBA loading function for 4 RGB pixels, which should be read
// together.
TEST(LoadToNative3To4, LoadUbyteRGBToRGBADataFourPixelsWithFourthCompOf01)
{}

// Tests the sbyte (0x7F) RGB to RGBA loading function for 4 RGB pixels, which should be read
// together.
TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataFourPixelsWithFourthCompOf7F)
{}

// Tests the sbyte (0x01) RGB to RGBA loading function for 4 RGB pixels, which should be read
// together.
TEST(LoadToNative3To4, LoadSbyteRGBToRGBADataFourPixelsWithFourthCompOf01)
{}

// Tests the byte RGB to RGBA loading function when the width is 4-byte aligned. This loading
// function can copy 4 bytes at a time in a row.
TEST(LoadToNative3To4, LoadByteRGBToRGBADataAlignedWidth)
{}

// Tests the byte RGB to RGBA loading function when the width is not 4-byte aligned, which will
// cause the loading function to copy some bytes in the beginning and end of some rows individually.
TEST(LoadToNative3To4, LoadByteRGBToRGBADataUnalignedWidth)
{}

// Tests the byte RGB to RGBA loading function when there is depth.
TEST(LoadToNative3To4, LoadByteRGBToRGBADataWithDepth)
{}

// Tests the byte RGB to RGBA loading function when the width is less than 4 bytes. Therefore the
// loading function will copy data one byte at a time.
TEST(LoadToNative3To4, LoadByteRGBToRGBADataWidthLessThanUint32)
{}

// Tests the byte RGB to RGBA loading function when when the width is 4-byte-aligned and the input
// address has an offset.
TEST(LoadToNative3To4, LoadByteRGBToRGBAWithAlignedWidthAndInputAddressOffset)
{}

// Tests the byte RGB to RGBA loading function when when the width is not 4-byte-aligned and the
// input address has an offset.
TEST(LoadToNative3To4, LoadByteRGBToRGBAWithUnalignedWidthAndInputAddressOffset)
{}

// Tests the byte RGB to RGBA loading function when the width is 4-byte-aligned and the output
// address has an offset.
TEST(LoadToNative3To4, LoadByteRGBToRGBAWithAlignedWidthAndOutputAddressOffset)
{}

// Tests the byte RGB to RGBA loading function when the width is not 4-byte-aligned and the output
// address has an offset.
TEST(LoadToNative3To4, LoadByteRGBToRGBAWithUnalignedWidthAndOutputAddressOffset)
{}

// Tests the byte RGB to RGBA loading function when the width is 4-byte-aligned and the input row
// alignment is 4.
TEST(LoadToNative3To4, LoadByteRGBToRGBAWithAlignedWidthAndAlignment4)
{}

// Tests the byte RGB to RGBA loading function when the width is not 4-byte-aligned and the input
// row alignment is 4.
TEST(LoadToNative3To4, LoadByteRGBToRGBAWithUnalignedWidthAndAlignment4)
{}
}  // namespace