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

Side by Side Diff: gpu/command_buffer/service/shader_translator_unittest.cc

Issue 682743002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 6
7 #include "gpu/command_buffer/service/shader_translator.h" 7 #include "gpu/command_buffer/service/shader_translator.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace gpu { 10 namespace gpu {
11 namespace gles2 { 11 namespace gles2 {
12 12
13 class ShaderTranslatorTest : public testing::Test { 13 class ShaderTranslatorTest : public testing::Test {
14 public: 14 public:
15 ShaderTranslatorTest() { 15 ShaderTranslatorTest() {
16 } 16 }
17 17
18 virtual ~ShaderTranslatorTest() { 18 ~ShaderTranslatorTest() override {}
19 }
20 19
21 protected: 20 protected:
22 virtual void SetUp() { 21 void SetUp() override {
23 ShBuiltInResources resources; 22 ShBuiltInResources resources;
24 ShInitBuiltInResources(&resources); 23 ShInitBuiltInResources(&resources);
25 resources.MaxExpressionComplexity = 32; 24 resources.MaxExpressionComplexity = 32;
26 resources.MaxCallStackDepth = 32; 25 resources.MaxCallStackDepth = 32;
27 26
28 vertex_translator_ = new ShaderTranslator(); 27 vertex_translator_ = new ShaderTranslator();
29 fragment_translator_ = new ShaderTranslator(); 28 fragment_translator_ = new ShaderTranslator();
30 29
31 ASSERT_TRUE(vertex_translator_->Init( 30 ASSERT_TRUE(vertex_translator_->Init(
32 GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources, 31 GL_VERTEX_SHADER, SH_GLES2_SPEC, &resources,
33 ShaderTranslatorInterface::kGlsl, 32 ShaderTranslatorInterface::kGlsl,
34 SH_EMULATE_BUILT_IN_FUNCTIONS)); 33 SH_EMULATE_BUILT_IN_FUNCTIONS));
35 ASSERT_TRUE(fragment_translator_->Init( 34 ASSERT_TRUE(fragment_translator_->Init(
36 GL_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources, 35 GL_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources,
37 ShaderTranslatorInterface::kGlsl, 36 ShaderTranslatorInterface::kGlsl,
38 static_cast<ShCompileOptions>(0))); 37 static_cast<ShCompileOptions>(0)));
39 } 38 }
40 virtual void TearDown() { 39 void TearDown() override {
41 vertex_translator_ = NULL; 40 vertex_translator_ = NULL;
42 fragment_translator_ = NULL; 41 fragment_translator_ = NULL;
43 } 42 }
44 43
45 scoped_refptr<ShaderTranslator> vertex_translator_; 44 scoped_refptr<ShaderTranslator> vertex_translator_;
46 scoped_refptr<ShaderTranslator> fragment_translator_; 45 scoped_refptr<ShaderTranslator> fragment_translator_;
47 }; 46 };
48 47
49 TEST_F(ShaderTranslatorTest, ValidVertexShader) { 48 TEST_F(ShaderTranslatorTest, ValidVertexShader) {
50 const char* shader = 49 const char* shader =
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 333
335 EXPECT_EQ(options_1, options_2); 334 EXPECT_EQ(options_1, options_2);
336 EXPECT_NE(options_1, options_3); 335 EXPECT_NE(options_1, options_3);
337 EXPECT_NE(options_1, options_4); 336 EXPECT_NE(options_1, options_4);
338 EXPECT_NE(options_3, options_4); 337 EXPECT_NE(options_3, options_4);
339 } 338 }
340 339
341 } // namespace gles2 340 } // namespace gles2
342 } // namespace gpu 341 } // namespace gpu
343 342
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/shader_manager_unittest.cc ('k') | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698