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

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

Issue 169603002: Add initial support for NV_path_rendering extension to gpu command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 8 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
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

Powered by Google App Engine
This is Rietveld 408576698