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

Unified Diff: gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc

Issue 2138023002: command_buffer: don't test the gl_clear workaround on core profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc b/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc
index b4404091da21de443fc43bc2d45a5eb61b5ba343..6b31c9b4cae1970c6412cb41d0cab1b0c1d34d24 100644
--- a/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc
+++ b/gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc
@@ -20,6 +20,8 @@
#include "gpu/config/gpu_switches.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_version_info.h"
namespace gpu {
@@ -43,6 +45,14 @@ class GLClearFramebufferTest : public testing::TestWithParam<bool> {
}
}
+ bool IsApplicable() {
+ // The workaround doesn't use VAOs which would cause a failure on a core
+ // context and the hardware for each the workaround is necessary has a buggy
+ // VAO implementation. So we skip testing the workaround on core profiles.
+ return !GetParam() ||
+ !gl_.context()->GetVersionInfo()->is_desktop_core_profile;
+ }
+
void InitDraw();
void SetDrawColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
void SetDrawDepth(GLfloat depth);
@@ -108,6 +118,10 @@ INSTANTIATE_TEST_CASE_P(GLClearFramebufferTestWithParam,
::testing::Values(true, false));
TEST_P(GLClearFramebufferTest, ClearColor) {
+ if (!IsApplicable()) {
+ return;
+ }
+
glClearColor(1.0f, 0.5f, 0.25f, 0.5f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -118,6 +132,10 @@ TEST_P(GLClearFramebufferTest, ClearColor) {
}
TEST_P(GLClearFramebufferTest, ClearColorWithMask) {
+ if (!IsApplicable()) {
+ return;
+ }
+
glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -131,6 +149,10 @@ TEST_P(GLClearFramebufferTest, ClearColorWithMask) {
// crbug.com/434094
#if !defined(OS_MACOSX)
TEST_P(GLClearFramebufferTest, ClearColorWithScissor) {
+ if (!IsApplicable()) {
+ return;
+ }
+
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -151,6 +173,10 @@ TEST_P(GLClearFramebufferTest, ClearColorWithScissor) {
#endif
TEST_P(GLClearFramebufferTest, ClearDepthStencil) {
+ if (!IsApplicable()) {
+ return;
+ }
+
const GLuint kStencilRef = 1 << 2;
InitDraw();
SetDrawColor(1.0f, 0.0f, 0.0f, 1.0f);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698