chromium/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <GLES2/gl2.h>
#include <GLES2/gl2chromium.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2extchromium.h>
#include <stdint.h>

#include <memory>

#include "base/functional/bind.h"
#include "base/memory/ref_counted.h"
#include "base/process/process_handle.h"
#include "build/build_config.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
#include "gpu/command_buffer/tests/gl_manager.h"
#include "gpu/command_buffer/tests/gl_test_utils.h"
#include "gpu/config/gpu_test_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/libyuv/include/libyuv.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/half_float.h"
#include "ui/gl/test/gl_test_support.h"

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h"
#include "ui/gfx/linux/client_native_pixmap_factory_dmabuf.h"
#endif

#define SKIP_TEST_IF(cmd)

_;
IgnoreResult;
InvokeWithoutArgs;
Invoke;
Return;
SetArgPointee;
StrictMock;

namespace gpu {
namespace gles2 {

static const int kImageWidth =;
static const int kImageHeight =;

class GpuMemoryBufferTest : public testing::TestWithParam<gfx::BufferFormat> {};

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
class GpuMemoryBufferTestEGL : public testing::Test,
                               public gpu::GpuCommandBufferTestEGL {};
#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)

namespace {

#define SHADER(Src)

uint32_t BufferFormatToFourCC(gfx::BufferFormat format) {}

}  // namespace

// Verifies that the read-back colour after map-write-unmap is the original.
TEST_P(GpuMemoryBufferTest, MapUnmap) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace gles2
}  // namespace gpu