summaryrefslogtreecommitdiffstats
path: root/cc/test/test_gles2_interface.cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-08 22:14:11 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-08 22:14:11 +0000
commita99d82fff6f153284981a7c44b2f9303de31e012 (patch)
treeca979dfb00ce009718da7f837b13a3cdc7eaf118 /cc/test/test_gles2_interface.cc
parent18aa701dea5ef746a52ef43ee7f209abedb78182 (diff)
downloadchromium_src-a99d82fff6f153284981a7c44b2f9303de31e012.zip
chromium_src-a99d82fff6f153284981a7c44b2f9303de31e012.tar.gz
chromium_src-a99d82fff6f153284981a7c44b2f9303de31e012.tar.bz2
Use GLES2Interface for shaders and programs
This uses the gpu::gles2::GLES2Interface type in the gl renderer's shader and program code instead of WebGraphicsContext3D. For production code, the GLES2Interface is a direct interface to the real command buffer in use. For cc_unittests, the GLES2Interface is a stub that wraps TestWebGraphicsContext3D so we can continue to use the same stubs/mocks for now. Once we port all of the production code over to using GLES2Interface we should port the test context classes over to the new base interface. BUG=181120 Review URL: https://codereview.chromium.org/93433004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/test_gles2_interface.cc')
-rw-r--r--cc/test/test_gles2_interface.cc51
1 files changed, 51 insertions, 0 deletions
diff --git a/cc/test/test_gles2_interface.cc b/cc/test/test_gles2_interface.cc
new file mode 100644
index 0000000..c9502d5
--- /dev/null
+++ b/cc/test/test_gles2_interface.cc
@@ -0,0 +1,51 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/test_gles2_interface.h"
+
+#include "base/logging.h"
+#include "cc/test/test_web_graphics_context_3d.h"
+
+namespace cc {
+
+TestGLES2Interface::TestGLES2Interface(TestWebGraphicsContext3D* test_context)
+ : test_context_(test_context) {
+ DCHECK(test_context_);
+}
+
+TestGLES2Interface::~TestGLES2Interface() {}
+
+GLuint TestGLES2Interface::CreateShader(GLenum type) {
+ return test_context_->createShader(type);
+}
+
+GLuint TestGLES2Interface::CreateProgram() {
+ return test_context_->createProgram();
+}
+
+void TestGLES2Interface::GetShaderiv(GLuint shader,
+ GLenum pname,
+ GLint* params) {
+ test_context_->getShaderiv(shader, pname, params);
+}
+
+void TestGLES2Interface::GetProgramiv(GLuint program,
+ GLenum pname,
+ GLint* params) {
+ test_context_->getProgramiv(program, pname, params);
+}
+
+void TestGLES2Interface::GetShaderPrecisionFormat(GLenum shadertype,
+ GLenum precisiontype,
+ GLint* range,
+ GLint* precision) {
+ test_context_->getShaderPrecisionFormat(
+ shadertype, precisiontype, range, precision);
+}
+
+void TestGLES2Interface::UseProgram(GLuint program) {
+ test_context_->useProgram(program);
+}
+
+} // namespace cc