#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <memory>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/containers/heap_array.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/strings/stringprintf.h"
#include "gpu/perftests/measurements.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/vector2d_f.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_enums.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gl_utils.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/gpu_timing.h"
#include "ui/gl/init/gl_factory.h"
#include "ui/gl/scoped_make_current.h"
namespace gpu {
namespace {
const int kUploadPerfWarmupRuns = …;
const int kUploadPerfTestRuns = …;
#define SHADER(Src) …
const char kVertexShader[] = …;
const char kShaderDefaultFloatPrecision[] = …;
const char kFragmentShader[] = …;
void CheckNoGlError(const std::string& msg) { … }
GLuint LoadShader(const GLenum type, const char* const src) { … }
int GLFormatBytePerPixel(GLenum format) { … }
GLenum GLFormatToInternalFormat(GLenum format) { … }
GLenum GLFormatToStorageFormat(GLenum format) { … }
void GenerateTextureData(const gfx::Size& size,
int bytes_per_pixel,
const int seed,
std::vector<uint8_t>* const pixels) { … }
bool CompareBufferToRGBABuffer(GLenum format,
const gfx::Size& size,
const std::vector<uint8_t>& pixels,
const std::vector<uint8_t>& rgba) { … }
class TextureUploadPerfTest : public testing::Test { … };
TEST_F(TextureUploadPerfTest, upload) { … }
TEST_F(TextureUploadPerfTest, renaming) { … }
}
}