1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "gpu/gles2_conform_support/egl/config.h"
17 bind_to_texture_rgb_(EGL_DONT_CARE
),
18 bind_to_texture_rgba_(EGL_DONT_CARE
),
19 color_buffer_type_(EGL_RGB_BUFFER
),
20 config_caveat_(EGL_DONT_CARE
),
21 config_id_(EGL_DONT_CARE
),
22 conformant_(EGL_OPENGL_ES2_BIT
),
25 max_pbuffer_width_(0),
26 max_pbuffer_height_(0),
27 max_pbuffer_pixels_(0),
28 min_swap_interval_(EGL_DONT_CARE
),
29 max_swap_interval_(EGL_DONT_CARE
),
30 native_renderable_(EGL_DONT_CARE
),
32 native_visual_type_(EGL_DONT_CARE
),
33 renderable_type_(EGL_OPENGL_ES2_BIT
),
37 surface_type_(EGL_WINDOW_BIT
),
38 transparent_type_(EGL_NONE
),
39 transparent_red_value_(EGL_DONT_CARE
),
40 transparent_green_value_(EGL_DONT_CARE
),
41 transparent_blue_value_(EGL_DONT_CARE
) {
47 bool Config::GetAttrib(EGLint attribute
, EGLint
* value
) const {
48 // TODO(alokp): Find out how to get correct values.
51 *value
= buffer_size_
;
62 case EGL_LUMINANCE_SIZE
:
63 *value
= luminance_size_
;
68 case EGL_ALPHA_MASK_SIZE
:
69 *value
= alpha_mask_size_
;
71 case EGL_BIND_TO_TEXTURE_RGB
:
72 *value
= bind_to_texture_rgb_
;
74 case EGL_BIND_TO_TEXTURE_RGBA
:
75 *value
= bind_to_texture_rgba_
;
77 case EGL_COLOR_BUFFER_TYPE
:
78 *value
= color_buffer_type_
;
80 case EGL_CONFIG_CAVEAT
:
81 *value
= config_caveat_
;
95 case EGL_MAX_PBUFFER_WIDTH
:
96 *value
= max_pbuffer_width_
;
98 case EGL_MAX_PBUFFER_HEIGHT
:
99 *value
= max_pbuffer_height_
;
101 case EGL_MAX_PBUFFER_PIXELS
:
102 *value
= max_pbuffer_pixels_
;
104 case EGL_MIN_SWAP_INTERVAL
:
105 *value
= min_swap_interval_
;
107 case EGL_MAX_SWAP_INTERVAL
:
108 *value
= max_swap_interval_
;
110 case EGL_NATIVE_RENDERABLE
:
111 *value
= native_renderable_
;
113 case EGL_NATIVE_VISUAL_ID
:
114 *value
= native_visual_id_
;
116 case EGL_NATIVE_VISUAL_TYPE
:
117 *value
= native_visual_type_
;
119 case EGL_RENDERABLE_TYPE
:
120 *value
= renderable_type_
;
122 case EGL_SAMPLE_BUFFERS
:
123 *value
= sample_buffers_
;
128 case EGL_STENCIL_SIZE
:
129 *value
= stencil_size_
;
131 case EGL_SURFACE_TYPE
:
132 *value
= surface_type_
;
134 case EGL_TRANSPARENT_TYPE
:
135 *value
= transparent_type_
;
137 case EGL_TRANSPARENT_RED_VALUE
:
138 *value
= transparent_red_value_
;
140 case EGL_TRANSPARENT_GREEN_VALUE
:
141 *value
= transparent_green_value_
;
143 case EGL_TRANSPARENT_BLUE_VALUE
:
144 *value
= transparent_blue_value_
;