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

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

Issue 2291753002: Prevent crash when using getExtension while a PBO is bound. (Closed)
Patch Set: work around the fact that a bunch of mocking tests pretend to test ES3 but don't Created 4 years, 3 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
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 "gpu/command_buffer/service/program_manager.h" 5 #include "gpu/command_buffer/service/program_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 kMaxDrawBuffers, 63 kMaxDrawBuffers,
64 kMaxDualSourceDrawBuffers, 64 kMaxDualSourceDrawBuffers,
65 kMaxVertexAttribs, 65 kMaxVertexAttribs,
66 gpu_preferences_, 66 gpu_preferences_,
67 feature_info_.get())); 67 feature_info_.get()));
68 } 68 }
69 void SetUpBase(const char* gl_version, 69 void SetUpBase(const char* gl_version,
70 const char* gl_extensions, 70 const char* gl_extensions,
71 FeatureInfo* feature_info = nullptr) { 71 FeatureInfo* feature_info = nullptr) {
72 GpuServiceTest::SetUpWithGLVersion(gl_version, gl_extensions); 72 GpuServiceTest::SetUpWithGLVersion(gl_version, gl_extensions);
73 ContextType context_type = CONTEXT_TYPE_OPENGLES2;
74 if (feature_info) {
Zhenyao Mo 2016/08/31 00:15:19 nit: You can move if (!feature_info) feature_info
Kai Ninomiya 2016/08/31 00:47:59 Done (not yet uploaded).
75 context_type = feature_info->context_type();
76 }
73 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 77 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
74 gl_.get(), gl_extensions, "", gl_version); 78 gl_.get(), gl_extensions, "", gl_version, context_type);
75 if (!feature_info) 79 if (!feature_info)
76 feature_info = new FeatureInfo(); 80 feature_info = new FeatureInfo();
77 feature_info->InitializeForTesting(); 81 feature_info->InitializeForTesting();
78 feature_info_ = feature_info; 82 feature_info_ = feature_info;
79 SetupProgramManager(); 83 SetupProgramManager();
80 } 84 }
81 void SetUp() override { 85 void SetUp() override {
82 // Parameters same as GpuServiceTest::SetUp 86 // Parameters same as GpuServiceTest::SetUp
83 SetUpBase("2.0", "GL_EXT_framebuffer_object"); 87 SetUpBase("2.0", "GL_EXT_framebuffer_object");
84 } 88 }
(...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after
2521 ProgramManagerDualSourceBlendingES2Test, 2525 ProgramManagerDualSourceBlendingES2Test,
2522 testing::Values( 2526 testing::Values(
2523 make_gl_ext_tuple("3.2", 2527 make_gl_ext_tuple("3.2",
2524 "GL_ARB_draw_buffers GL_ARB_blend_func_extended " 2528 "GL_ARB_draw_buffers GL_ARB_blend_func_extended "
2525 "GL_ARB_program_interface_query"), 2529 "GL_ARB_program_interface_query"),
2526 make_gl_ext_tuple("opengl es 3.1", 2530 make_gl_ext_tuple("opengl es 3.1",
2527 "GL_EXT_draw_buffers GL_EXT_blend_func_extended"))); 2531 "GL_EXT_draw_buffers GL_EXT_blend_func_extended")));
2528 2532
2529 } // namespace gles2 2533 } // namespace gles2
2530 } // namespace gpu 2534 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698