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

Unified Diff: gpu/gles2_conform_support/egl/config.cc

Issue 7057033: Move OpenGL ES 2.0 conformance test support into main tree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for osx Created 9 years, 7 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 | « gpu/gles2_conform_support/egl/config.h ('k') | gpu/gles2_conform_support/egl/display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/gles2_conform_support/egl/config.cc
diff --git a/gpu/gles2_conform_support/egl/config.cc b/gpu/gles2_conform_support/egl/config.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6c914be905a340d258bb191eae8c6e4b41b304fe
--- /dev/null
+++ b/gpu/gles2_conform_support/egl/config.cc
@@ -0,0 +1,152 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/gles2_conform_support/egl/config.h"
+
+namespace egl {
+
+Config::Config()
+ : buffer_size_(0),
+ red_size_(0),
+ green_size_(0),
+ blue_size_(0),
+ luminance_size_(0),
+ alpha_size_(0),
+ alpha_mask_size_(0),
+ bind_to_texture_rgb_(EGL_DONT_CARE),
+ bind_to_texture_rgba_(EGL_DONT_CARE),
+ color_buffer_type_(EGL_RGB_BUFFER),
+ config_caveat_(EGL_DONT_CARE),
+ config_id_(EGL_DONT_CARE),
+ conformant_(EGL_OPENGL_ES2_BIT),
+ depth_size_(0),
+ level_(0),
+ max_pbuffer_width_(0),
+ max_pbuffer_height_(0),
+ max_pbuffer_pixels_(0),
+ min_swap_interval_(EGL_DONT_CARE),
+ max_swap_interval_(EGL_DONT_CARE),
+ native_renderable_(EGL_DONT_CARE),
+ native_visual_id_(0),
+ native_visual_type_(EGL_DONT_CARE),
+ renderable_type_(EGL_OPENGL_ES2_BIT),
+ sample_buffers_(0),
+ samples_(0),
+ stencil_size_(0),
+ surface_type_(EGL_WINDOW_BIT),
+ transparent_type_(EGL_NONE),
+ transparent_red_value_(EGL_DONT_CARE),
+ transparent_green_value_(EGL_DONT_CARE),
+ transparent_blue_value_(EGL_DONT_CARE) {
+}
+
+Config::~Config() {
+}
+
+bool Config::GetAttrib(EGLint attribute, EGLint* value) const {
+ // TODO(alokp): Find out how to get correct values.
+ switch (attribute) {
+ case EGL_BUFFER_SIZE:
+ *value = buffer_size_;
+ break;
+ case EGL_RED_SIZE:
+ *value = red_size_;
+ break;
+ case EGL_GREEN_SIZE:
+ *value = green_size_;
+ break;
+ case EGL_BLUE_SIZE:
+ *value = blue_size_;
+ break;
+ case EGL_LUMINANCE_SIZE:
+ *value = luminance_size_;
+ break;
+ case EGL_ALPHA_SIZE:
+ *value = alpha_size_;
+ break;
+ case EGL_ALPHA_MASK_SIZE:
+ *value = alpha_mask_size_;
+ break;
+ case EGL_BIND_TO_TEXTURE_RGB:
+ *value = bind_to_texture_rgb_;
+ break;
+ case EGL_BIND_TO_TEXTURE_RGBA:
+ *value = bind_to_texture_rgba_;
+ break;
+ case EGL_COLOR_BUFFER_TYPE:
+ *value = color_buffer_type_;
+ break;
+ case EGL_CONFIG_CAVEAT:
+ *value = config_caveat_;
+ break;
+ case EGL_CONFIG_ID:
+ *value = config_id_;
+ break;
+ case EGL_CONFORMANT:
+ *value = conformant_;
+ break;
+ case EGL_DEPTH_SIZE:
+ *value = depth_size_;
+ break;
+ case EGL_LEVEL:
+ *value = level_;
+ break;
+ case EGL_MAX_PBUFFER_WIDTH:
+ *value = max_pbuffer_width_;
+ break;
+ case EGL_MAX_PBUFFER_HEIGHT:
+ *value = max_pbuffer_height_;
+ break;
+ case EGL_MAX_PBUFFER_PIXELS:
+ *value = max_pbuffer_pixels_;
+ break;
+ case EGL_MIN_SWAP_INTERVAL:
+ *value = min_swap_interval_;
+ break;
+ case EGL_MAX_SWAP_INTERVAL:
+ *value = max_swap_interval_;
+ break;
+ case EGL_NATIVE_RENDERABLE:
+ *value = native_renderable_;
+ break;
+ case EGL_NATIVE_VISUAL_ID:
+ *value = native_visual_id_;
+ break;
+ case EGL_NATIVE_VISUAL_TYPE:
+ *value = native_visual_type_;
+ break;
+ case EGL_RENDERABLE_TYPE:
+ *value = renderable_type_;
+ break;
+ case EGL_SAMPLE_BUFFERS:
+ *value = sample_buffers_;
+ break;
+ case EGL_SAMPLES:
+ *value = samples_;
+ break;
+ case EGL_STENCIL_SIZE:
+ *value = stencil_size_;
+ break;
+ case EGL_SURFACE_TYPE:
+ *value = surface_type_;
+ break;
+ case EGL_TRANSPARENT_TYPE:
+ *value = transparent_type_;
+ break;
+ case EGL_TRANSPARENT_RED_VALUE:
+ *value = transparent_red_value_;
+ break;
+ case EGL_TRANSPARENT_GREEN_VALUE:
+ *value = transparent_green_value_;
+ break;
+ case EGL_TRANSPARENT_BLUE_VALUE:
+ *value = transparent_blue_value_;
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+} // namespace egl
« no previous file with comments | « gpu/gles2_conform_support/egl/config.h ('k') | gpu/gles2_conform_support/egl/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698