OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include <GLES2/gl2.h> | |
6 #include <GLES2/gl2ext.h> | |
7 #include <GLES2/gl2extchromium.h> | |
8 | |
9 #include "gpu/command_buffer/tests/gl_manager.h" | |
10 #include "gpu/command_buffer/tests/gl_test_utils.h" | |
11 #include "testing/gmock/include/gmock/gmock.h" | |
12 #include "testing/gtest/include/gtest/gtest.h" | |
13 | |
14 namespace gpu { | |
15 | |
16 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.
| |
17 public: | |
18 static const GLsizei kResolution = 100; | |
19 | |
20 protected: | |
21 virtual void SetUp() { | |
22 GLManager::Options options; | |
23 options.size = gfx::Size(kResolution, kResolution); | |
24 gl_.Initialize(options); | |
25 } | |
26 | |
27 virtual void TearDown() { | |
28 gl_.Destroy(); | |
29 } | |
30 | |
31 GLManager gl_; | |
32 }; | |
33 | |
34 TEST_F(CHROMIUMNVPathRenderingTest, TestMatrix) { | |
35 if (!GLTestHelper::HasExtension("GL_CHROMIUM_NV_path_rendering")) { | |
36 return; | |
37 } | |
38 glMatrixMode(GL_MODELVIEW); | |
39 glLoadIdentity(); | |
40 | |
41 GLfloat matrix[16] = { | |
42 10.0f, 0.0f, 0.0f, 1.0f, | |
43 0.0f, 10.0f, 0.0f, 1.0f, | |
44 0.0f, 0.0f, 10.0f, 1.0f, | |
45 0.0f, 0.0f, 0.0f, 1.0 | |
46 }; | |
47 glLoadMatrixf(matrix); | |
48 glMatrixMode(GL_PROJECTION); | |
49 glLoadMatrixf(matrix); | |
50 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.
| |
51 } | |
52 | |
53 } // namespace gpu | |
OLD | NEW |