Index: gpu/command_buffer/tests/gl_chromium_nv_path_rendering_unittest.cc |
diff --git a/gpu/command_buffer/tests/gl_chromium_nv_path_rendering_unittest.cc b/gpu/command_buffer/tests/gl_chromium_nv_path_rendering_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4050ce2b7f91c081612967b446685fa2307590f7 |
--- /dev/null |
+++ b/gpu/command_buffer/tests/gl_chromium_nv_path_rendering_unittest.cc |
@@ -0,0 +1,53 @@ |
+// Copyright (c) 2012 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 <GLES2/gl2.h> |
+#include <GLES2/gl2ext.h> |
+#include <GLES2/gl2extchromium.h> |
+ |
+#include "gpu/command_buffer/tests/gl_manager.h" |
+#include "gpu/command_buffer/tests/gl_test_utils.h" |
+#include "testing/gmock/include/gmock/gmock.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace gpu { |
+ |
+class CHROMIUMNVPathRenderingTest : public testing::Test { |
piman
2014/04/11 22:19:27
nit: s/CHROMIUMNV/CHROMIUM/
Kimmo Kinnunen
2014/04/15 16:16:58
Done.
|
+public: |
+ static const GLsizei kResolution = 100; |
+ |
+protected: |
+ virtual void SetUp() { |
+ GLManager::Options options; |
+ options.size = gfx::Size(kResolution, kResolution); |
+ gl_.Initialize(options); |
+ } |
+ |
+ virtual void TearDown() { |
+ gl_.Destroy(); |
+ } |
+ |
+ GLManager gl_; |
+}; |
+ |
+TEST_F(CHROMIUMNVPathRenderingTest, TestMatrix) { |
+ if (!GLTestHelper::HasExtension("GL_CHROMIUM_NV_path_rendering")) { |
+ return; |
+ } |
+ glMatrixMode(GL_MODELVIEW); |
+ glLoadIdentity(); |
+ |
+ GLfloat matrix[16] = { |
+ 10.0f, 0.0f, 0.0f, 1.0f, |
+ 0.0f, 10.0f, 0.0f, 1.0f, |
+ 0.0f, 0.0f, 10.0f, 1.0f, |
+ 0.0f, 0.0f, 0.0f, 1.0 |
+ }; |
+ glLoadMatrixf(matrix); |
+ glMatrixMode(GL_PROJECTION); |
+ glLoadMatrixf(matrix); |
+ EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); |
vmiura
2014/04/11 21:54:48
Can we add a test of reading back the matrices?
Kimmo Kinnunen
2014/04/14 12:56:30
In theory it can be added. That entry point would
vmiura
2014/04/14 19:08:29
I guess we have GL_MATRIX_MODE, but not GL_MODELVI
Kimmo Kinnunen
2014/04/15 16:16:58
Done.
|
+} |
+ |
+} // namespace gpu |