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

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

Issue 2656563002: Support cube map dest target for CopyTextureCHROMIUM extension (Closed)
Patch Set: fix nits Created 3 years, 11 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/command_buffer/tests/gl_test_utils.h ('k') | 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_test_utils.cc
diff --git a/gpu/command_buffer/tests/gl_test_utils.cc b/gpu/command_buffer/tests/gl_test_utils.cc
index 6fc8ff8e03c309d0a762a2ecc6ff0c60d2ef29ee..402a96946fa505dba402168f155889f1de0e2046 100644
--- a/gpu/command_buffer/tests/gl_test_utils.cc
+++ b/gpu/command_buffer/tests/gl_test_utils.cc
@@ -11,6 +11,7 @@
#include <memory>
#include <string>
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
@@ -277,10 +278,12 @@ bool GLTestHelper::SaveBackbufferAsBMP(
return true;
}
-void GLTestHelper::DrawTextureQuad(const char* vertex_src,
+void GLTestHelper::DrawTextureQuad(const GLenum texture_target,
+ const char* vertex_src,
const char* fragment_src,
const char* position_name,
- const char* sampler_name) {
+ const char* sampler_name,
+ const char* face_name) {
GLuint program = GLTestHelper::LoadProgram(vertex_src, fragment_src);
EXPECT_NE(program, 0u);
glUseProgram(program);
@@ -289,6 +292,14 @@ void GLTestHelper::DrawTextureQuad(const char* vertex_src,
GLint sampler_location = glGetUniformLocation(program, sampler_name);
ASSERT_NE(position_loc, -1);
ASSERT_NE(sampler_location, -1);
+ GLint face_loc = -1;
+ if (gpu::gles2::GLES2Util::GLFaceTargetToTextureTarget(texture_target) ==
+ GL_TEXTURE_CUBE_MAP) {
+ ASSERT_NE(face_name, nullptr);
+ face_loc = glGetUniformLocation(program, face_name);
+ ASSERT_NE(face_loc, -1);
+ glUniform1i(face_loc, texture_target);
+ }
GLuint vertex_buffer = GLTestHelper::SetupUnitQuad(position_loc);
ASSERT_NE(vertex_buffer, 0u);
« no previous file with comments | « gpu/command_buffer/tests/gl_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698