#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/viz/test/gl_scaler_test_util.h"
#include <algorithm>
#include <cmath>
#include <ostream>
#include "base/check_op.h"
#include "base/notreached.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "ui/gfx/geometry/rect.h"
namespace viz {
ColorBar;
SkBitmap GLScalerTestUtil::AllocateRGBABitmap(const gfx::Size& size) { … }
uint8_t GLScalerTestUtil::ToClamped255(float value) { … }
std::vector<ColorBar> GLScalerTestUtil::GetScaledSMPTEColorBars(
const gfx::Size& size) { … }
SkBitmap GLScalerTestUtil::CreateSMPTETestImage(const gfx::Size& size) { … }
bool GLScalerTestUtil::LooksLikeSMPTETestImage(const SkBitmap& image,
const gfx::Size& src_size,
const gfx::Rect& src_rect,
int fuzzy_pixels,
float* max_color_diff) { … }
SkBitmap GLScalerTestUtil::CreateCyclicalTestImage(
const gfx::Size& size,
CyclicalPattern pattern,
const std::vector<SkColor4f>& cycle,
size_t rotation) { … }
gfx::ColorSpace GLScalerTestUtil::DefaultRGBColorSpace() { … }
gfx::ColorSpace GLScalerTestUtil::DefaultYUVColorSpace() { … }
void GLScalerTestUtil::ConvertRGBABitmapToYUV(SkBitmap* image) { … }
SkBitmap GLScalerTestUtil::CopyAndConvertToRGBA(const SkBitmap& bitmap) { … }
void GLScalerTestUtil::SwizzleBitmap(SkBitmap* image) { … }
SkBitmap GLScalerTestUtil::CreatePackedPlanarBitmap(const SkBitmap& source,
int channel) { … }
void GLScalerTestUtil::UnpackPlanarBitmap(const SkBitmap& plane,
int channel,
SkBitmap* out) { … }
void GLScalerTestUtil::UnpackUVBitmap(const SkBitmap& plane, SkBitmap* out) { … }
SkBitmap GLScalerTestUtil::CreateVerticallyFlippedBitmap(
const SkBitmap& source) { … }
const ColorBar GLScalerTestUtil::kSMPTEColorBars[30] = …;
constexpr gfx::Size GLScalerTestUtil::kSMPTEFullSize;
GLScalerTestTextureHelper::GLScalerTestTextureHelper(
gpu::gles2::GLES2Interface* gl)
: … { … }
GLScalerTestTextureHelper::~GLScalerTestTextureHelper() { … }
GLuint GLScalerTestTextureHelper::CreateTexture(const gfx::Size& size) { … }
GLuint GLScalerTestTextureHelper::UploadTexture(const SkBitmap& bitmap) { … }
SkBitmap GLScalerTestTextureHelper::DownloadTexture(GLuint texture,
const gfx::Size& size) { … }
}