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

Side by Side Diff: ui/gl/test/egl_initialization_displays_unittest.cc

Issue 2680423002: Introducing 2 usages for SwiftShader (Closed)
Patch Set: Added missing change to GpuDataManagerImplPrivate Created 3 years, 10 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 unified diff | Download patch
« ui/gl/gl_implementation.cc ('K') | « ui/gl/init/gl_initializer_x11.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/gl/gl_surface_egl.h" 6 #include "ui/gl/gl_surface_egl.h"
7 7
8 namespace { 8 namespace {
9 9
10 TEST(EGLInitializationDisplaysTest, DisableD3D11) { 10 TEST(EGLInitializationDisplaysTest, DisableD3D11) {
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 TEST(EGLInitializationDisplaysTest, SwiftShader) { 41 TEST(EGLInitializationDisplaysTest, SwiftShader) {
42 std::unique_ptr<base::CommandLine> command_line( 42 std::unique_ptr<base::CommandLine> command_line(
43 new base::CommandLine(base::CommandLine::NO_PROGRAM)); 43 new base::CommandLine(base::CommandLine::NO_PROGRAM));
44 44
45 std::vector<gl::DisplayType> displays; 45 std::vector<gl::DisplayType> displays;
46 46
47 // If swiftshader is requested, only SWIFT_SHADER should be returned 47 // If swiftshader is requested, only SWIFT_SHADER should be returned
48 command_line->AppendSwitchASCII(switches::kUseGL, 48 command_line->AppendSwitchASCII(switches::kUseGL,
49 gl::kGLImplementationSwiftShaderName); 49 gl::kGLImplementationSwiftShaderForWebGLName);
50 displays.clear(); 50 displays.clear();
51 GetEGLInitDisplays(true, true, true, command_line.get(), &displays); 51 GetEGLInitDisplays(true, true, true, command_line.get(), &displays);
52 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::SWIFT_SHADER), 52 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::SWIFT_SHADER),
53 displays.end()); 53 displays.end());
54 EXPECT_EQ(displays.size(), 1u); 54 EXPECT_EQ(displays.size(), 1u);
55 55
56 // Even if there are other flags, swiftshader should take prescedence 56 // Even if there are other flags, swiftshader should take prescedence
57 command_line->AppendSwitchASCII(switches::kUseANGLE, 57 command_line->AppendSwitchASCII(switches::kUseANGLE,
58 gl::kANGLEImplementationD3D11Name); 58 gl::kANGLEImplementationD3D11Name);
59 displays.clear(); 59 displays.clear();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 // With no angle platform extensions, only DEFAULT should be available 126 // With no angle platform extensions, only DEFAULT should be available
127 std::vector<gl::DisplayType> displays; 127 std::vector<gl::DisplayType> displays;
128 GetEGLInitDisplays(false, false, false, command_line.get(), &displays); 128 GetEGLInitDisplays(false, false, false, command_line.get(), &displays);
129 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::DEFAULT), 129 EXPECT_NE(std::find(displays.begin(), displays.end(), gl::DEFAULT),
130 displays.end()); 130 displays.end());
131 EXPECT_EQ(displays.size(), 1u); 131 EXPECT_EQ(displays.size(), 1u);
132 } 132 }
133 133
134 } // namespace 134 } // namespace
OLDNEW
« ui/gl/gl_implementation.cc ('K') | « ui/gl/init/gl_initializer_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698