Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: ui/gl/gl_surface_format.cc

Issue 2764853002: gl: Remove redundant methods/variables from GLSurfaceFormat (Closed)
Patch Set: Replaced format.IsDefault() check with format.IsCompatible(GLSurfaceFormat()) Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_surface_format.h ('k') | ui/gl/gl_surface_format_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_format.cc
diff --git a/ui/gl/gl_surface_format.cc b/ui/gl/gl_surface_format.cc
index b57dbdb847e9dddb773d6ccc82506dfacd926aa3..ff7f6606c8d8f6afcc21d3d7c94632cc0e10164d 100644
--- a/ui/gl/gl_surface_format.cc
+++ b/ui/gl/gl_surface_format.cc
@@ -11,7 +11,6 @@ GLSurfaceFormat::GLSurfaceFormat() {
}
GLSurfaceFormat::GLSurfaceFormat(SurfacePixelLayout layout) {
- is_default_ = false;
pixel_layout_ = layout;
}
@@ -20,10 +19,6 @@ GLSurfaceFormat::GLSurfaceFormat(const GLSurfaceFormat& other) = default;
GLSurfaceFormat::~GLSurfaceFormat() {
}
-bool GLSurfaceFormat::IsSurfaceless() {
- return is_surfaceless_;
-}
-
GLSurfaceFormat::SurfacePixelLayout GLSurfaceFormat::GetPixelLayout() {
return pixel_layout_;
}
@@ -32,7 +27,6 @@ void GLSurfaceFormat::SetDefaultPixelLayout(SurfacePixelLayout layout) {
if (pixel_layout_ == PIXEL_LAYOUT_DONT_CARE &&
layout != PIXEL_LAYOUT_DONT_CARE) {
pixel_layout_ = layout;
- is_default_ = false;
}
}
@@ -40,12 +34,6 @@ void GLSurfaceFormat::SetRGB565() {
red_bits_ = blue_bits_ = 5;
green_bits_ = 6;
alpha_bits_ = 0;
- is_default_ = false;
-}
-
-void GLSurfaceFormat::SetIsSurfaceless() {
- is_surfaceless_ = true;
- is_default_ = false;
}
static int GetValue(int num, int default_value) {
@@ -56,14 +44,7 @@ static int GetBitSize(int num) {
return GetValue(num, 8);
}
-
-bool GLSurfaceFormat::IsDefault() {
- return is_default_;
-}
-
bool GLSurfaceFormat::IsCompatible(GLSurfaceFormat other) {
- if (IsDefault() && other.IsDefault()) return true;
-
if (GetBitSize(red_bits_) == GetBitSize(other.red_bits_) &&
GetBitSize(green_bits_) == GetBitSize(other.green_bits_) &&
GetBitSize(blue_bits_) == GetBitSize(other.blue_bits_) &&
@@ -71,7 +52,6 @@ bool GLSurfaceFormat::IsCompatible(GLSurfaceFormat other) {
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) &&
- is_surfaceless_ == other.is_surfaceless_ &&
pixel_layout_ == other.pixel_layout_) {
return true;
}
@@ -81,7 +61,6 @@ bool GLSurfaceFormat::IsCompatible(GLSurfaceFormat other) {
void GLSurfaceFormat::SetDepthBits(int bits) {
if (bits != -1) {
depth_bits_ = bits;
- is_default_ = false;
}
}
@@ -92,7 +71,6 @@ int GLSurfaceFormat::GetDepthBits() {
void GLSurfaceFormat::SetStencilBits(int bits) {
if (bits != -1) {
stencil_bits_ = bits;
- is_default_ = false;
}
}
@@ -103,7 +81,6 @@ int GLSurfaceFormat::GetStencilBits() {
void GLSurfaceFormat::SetSamples(int num) {
if (num != -1) {
samples_ = num;
- is_default_ = false;
}
}
« no previous file with comments | « ui/gl/gl_surface_format.h ('k') | ui/gl/gl_surface_format_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698