#include "gpu/command_buffer/service/shared_image/gl_repack_utils.h"
#include "base/strings/stringprintf.h"
#include "cc/test/pixel_comparator.h"
#include "cc/test/pixel_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
namespace gpu {
namespace {
static SkBitmap MakeSolidColorBitmap(const gfx::Size& size,
SkColorType color_type,
SkColor color) { … }
static SkBitmap MakeSolidColorBitmapWithStride(const gfx::Size& size,
SkColorType color_type,
SkColor color,
size_t stride) { … }
static void ValidateRgbPixelsRed(const gfx::Size& size,
size_t expected_stride,
const std::vector<uint8_t>& repacked_data) { … }
static void ValidateRgbaPixelsRed(const gfx::Size& size,
size_t expected_stride,
const std::vector<uint8_t>& repacked_data) { … }
TEST(RepackUtilsTest, BgrxAsRgb) { … }
TEST(RepackUtilsTest, BgrxAsRgbWithAlignedStride) { … }
TEST(RepackUtilsTest, BgrxAsRgbWithAlpha) { … }
TEST(RepackUtilsTest, BgrxAsRgbWithStrideMismatch) { … }
TEST(RepackUtilsTest, RgbxAsRgb) { … }
TEST(RepackUtilsTest, RepackStride) { … }
TEST(RepackUtilsTest, UnpackStride) { … }
TEST(RepackUtilsTest, SwizzleRedAndBlue) { … }
}
}