63 int redSize = glFormat.redBufferSize();
64 int greenSize = glFormat.greenBufferSize();
65 int blueSize = glFormat.blueBufferSize();
66 int alphaSize = glFormat.alphaBufferSize();
67 int depthSize = glFormat.depthBufferSize();
68 int stencilSize = glFormat.stencilBufferSize();
69 int sampleCount = glFormat.samples();
71 bool prefer32Bit =
false;
74 prefer32Bit = !QSymbianGraphicsSystemEx::hasBCM2727();
78 if (glFormat.alpha() && alphaSize <= 0)
80 if (glFormat.depth() && depthSize <= 0)
82 if (glFormat.stencil() && stencilSize <= 0)
84 if (glFormat.sampleBuffers() && sampleCount <= 0)
87 redSize = redSize > 0 ? redSize : 8;
88 greenSize = greenSize > 0 ? greenSize : 8;
89 blueSize = blueSize > 0 ? blueSize : 8;
90 alphaSize = alphaSize > 0 ? alphaSize : 8;
91 depthSize = depthSize > 0 ? depthSize : 24;
92 stencilSize = stencilSize > 0 ? stencilSize : 8;
93 sampleCount = sampleCount >= 0 ? sampleCount : 4;
97 if (glFormat.alpha() && alphaSize <= 0)
99 if (glFormat.depth() && depthSize <= 0)
101 if (glFormat.stencil() && stencilSize <= 0)
103 if (glFormat.sampleBuffers() && sampleCount <= 0)
125 redSize = redSize > 0 ? redSize : 0;
126 greenSize = greenSize > 0 ? greenSize : 0;
127 blueSize = blueSize > 0 ? blueSize : 0;
128 alphaSize = alphaSize > 0 ? alphaSize : 0;
129 depthSize = depthSize > 0 ? depthSize : 0;
130 stencilSize = stencilSize > 0 ? stencilSize : 0;
131 sampleCount = sampleCount > 0 ? sampleCount : 0;
134 eglProperties.setValue(EGL_RED_SIZE, redSize);
135 eglProperties.setValue(EGL_GREEN_SIZE, greenSize);
136 eglProperties.setValue(EGL_BLUE_SIZE, blueSize);
137 eglProperties.setValue(EGL_ALPHA_SIZE, alphaSize);
138 eglProperties.setValue(EGL_DEPTH_SIZE, depthSize);
139 eglProperties.setValue(EGL_STENCIL_SIZE, stencilSize);
140 eglProperties.setValue(EGL_SAMPLES, sampleCount);
141 eglProperties.setValue(EGL_SAMPLE_BUFFERS, sampleCount ? 1 : 0);