Commit 28d9b114 authored by Peng Huang's avatar Peng Huang Committed by Commit Bot

Remove not used SurfacePixelLayout from GLSurfaceFormat

Bug: 928873
Change-Id: If88e7712d01660343c743373ac2bebee109882bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610470Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659200}
parent d2dafc04
......@@ -15,21 +15,6 @@ GLSurfaceFormat::GLSurfaceFormat(const GLSurfaceFormat& other) = default;
GLSurfaceFormat::~GLSurfaceFormat() {
}
GLSurfaceFormat::GLSurfaceFormat(SurfacePixelLayout layout) {
pixel_layout_ = layout;
}
GLSurfaceFormat::SurfacePixelLayout GLSurfaceFormat::GetPixelLayout() const {
return pixel_layout_;
}
void GLSurfaceFormat::SetDefaultPixelLayout(SurfacePixelLayout layout) {
if (pixel_layout_ == PIXEL_LAYOUT_DONT_CARE &&
layout != PIXEL_LAYOUT_DONT_CARE) {
pixel_layout_ = layout;
}
}
void GLSurfaceFormat::SetRGB565() {
red_bits_ = blue_bits_ = 5;
green_bits_ = 6;
......@@ -51,8 +36,7 @@ bool GLSurfaceFormat::IsCompatible(GLSurfaceFormat other) const {
GetBitSize(alpha_bits_) == GetBitSize(other.alpha_bits_) &&
GetValue(stencil_bits_, 8) == GetValue(other.stencil_bits_, 8) &&
GetValue(depth_bits_, 24) == GetValue(other.depth_bits_, 24) &&
GetValue(samples_, 0) == GetValue(other.samples_, 0) &&
pixel_layout_ == other.pixel_layout_) {
GetValue(samples_, 0) == GetValue(other.samples_, 0)) {
return true;
}
return false;
......
......@@ -15,21 +15,10 @@ namespace gl {
// checking compatibility.
class GL_EXPORT GLSurfaceFormat {
public:
// For use with constructor.
enum SurfacePixelLayout {
PIXEL_LAYOUT_DONT_CARE = -1,
PIXEL_LAYOUT_BGRA,
PIXEL_LAYOUT_RGBA,
};
// Default surface format for the underlying gl_surface subtype.
// Use the setters below to change attributes if needed.
GLSurfaceFormat();
// Use a specified pixel layout, cf. GLSurfaceFormatTest.
GLSurfaceFormat(SurfacePixelLayout layout);
// Copy constructor from pre-existing format.
GLSurfaceFormat(const GLSurfaceFormat& other);
......@@ -58,9 +47,6 @@ class GL_EXPORT GLSurfaceFormat {
void SetSamples(int samples);
int GetSamples() const { return samples_; }
void SetDefaultPixelLayout(SurfacePixelLayout layout);
SurfacePixelLayout GetPixelLayout() const;
enum SurfaceColorSpace {
COLOR_SPACE_UNSPECIFIED = -1,
COLOR_SPACE_SRGB,
......@@ -77,7 +63,6 @@ class GL_EXPORT GLSurfaceFormat {
int GetBufferSize() const;
private:
SurfacePixelLayout pixel_layout_ = PIXEL_LAYOUT_DONT_CARE;
SurfaceColorSpace color_space_ = COLOR_SPACE_UNSPECIFIED;
int red_bits_ = -1;
int green_bits_ = -1;
......
......@@ -12,8 +12,6 @@ TEST(GLSurfaceFormatTest, BasicTest) {
// Check default format properties.
GLSurfaceFormat format = GLSurfaceFormat();
EXPECT_EQ(32, format.GetBufferSize());
EXPECT_EQ(GLSurfaceFormat::PIXEL_LAYOUT_DONT_CARE,
format.GetPixelLayout());
}
{
......@@ -22,21 +20,6 @@ TEST(GLSurfaceFormatTest, BasicTest) {
format.SetRGB565();
EXPECT_EQ(16, format.GetBufferSize());
}
{
// Check custom pixel layout.
GLSurfaceFormat format = GLSurfaceFormat(
GLSurfaceFormat::PIXEL_LAYOUT_RGBA);
EXPECT_EQ(GLSurfaceFormat::PIXEL_LAYOUT_RGBA,
format.GetPixelLayout());
// The custom pixel layout should remain after other modifications.
format.SetDepthBits(24);
EXPECT_EQ(GLSurfaceFormat::PIXEL_LAYOUT_RGBA,
format.GetPixelLayout());
EXPECT_EQ(24, format.GetDepthBits());
}
{
// Check IsCompatible
GLSurfaceFormat format = GLSurfaceFormat();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment