1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program EGL Module
3 * ---------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief GLES1 render utils.
22 *//*--------------------------------------------------------------------*/
24 #include "teglGLES1RenderUtil.hpp"
26 #if defined(DEQP_SUPPORT_GLES1)
39 #if defined(DEQP_SUPPORT_GLES1)
41 void clear (int x, int y, int width, int height, const tcu::Vec4& color)
43 glEnable(GL_SCISSOR_TEST);
44 glScissor(x, y, width, height);
45 glClearColor(color.x(), color.y(), color.z(), color.w());
46 glClear(GL_COLOR_BUFFER_BIT);
47 glDisable(GL_SCISSOR_TEST);
50 void readPixels (tcu::Surface& dst, int x, int y, int width, int height)
52 dst.setSize(width, height);
53 glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, dst.getAccess().getDataPtr());
61 #else // DEQP_SUPPORT_GLES1
63 void clear (int x, int y, int width, int height, const tcu::Vec4& color)
65 DE_UNREF(x && y && width && height);
67 TCU_THROW(NotSupportedError, "OpenGL ES 1.x is not supported");
70 void readPixels (tcu::Surface& dst, int x, int y, int width, int height)
72 DE_UNREF(x && y && width && height);
74 TCU_THROW(NotSupportedError, "OpenGL ES 1.x is not supported");
79 TCU_THROW(NotSupportedError, "OpenGL ES 1.x is not supported");
82 #endif // DEQP_SUPPORT_GLES1