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

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

Issue 2142353002: Validate fbo color image format and fragment shader output variable type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return static_cast<const uint8_t*>(position) - 52 return static_cast<const uint8_t*>(position) -
53 static_cast<const uint8_t*>(start); 53 static_cast<const uint8_t*>(start);
54 } 54 }
55 55
56 } // namespace anonymous 56 } // namespace anonymous
57 57
58 class ProgramManagerTestBase : public GpuServiceTest { 58 class ProgramManagerTestBase : public GpuServiceTest {
59 protected: 59 protected:
60 virtual void SetupProgramManager() { 60 virtual void SetupProgramManager() {
61 manager_.reset(new ProgramManager(nullptr, kMaxVaryingVectors, 61 manager_.reset(new ProgramManager(nullptr, kMaxVaryingVectors,
62 kMaxDrawBuffers,
62 kMaxDualSourceDrawBuffers, 63 kMaxDualSourceDrawBuffers,
63 gpu_preferences_, 64 gpu_preferences_,
64 feature_info_.get())); 65 feature_info_.get()));
65 } 66 }
66 void SetUpBase(const char* gl_version, 67 void SetUpBase(const char* gl_version,
67 const char* gl_extensions, 68 const char* gl_extensions,
68 FeatureInfo* feature_info = nullptr) { 69 FeatureInfo* feature_info = nullptr) {
69 GpuServiceTest::SetUpWithGLVersion(gl_version, gl_extensions); 70 GpuServiceTest::SetUpWithGLVersion(gl_version, gl_extensions);
70 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 71 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
71 gl_.get(), gl_extensions, "", gl_version); 72 gl_.get(), gl_extensions, "", gl_version);
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 ProgramManagerWithCacheTest() 1945 ProgramManagerWithCacheTest()
1945 : cache_(new MockProgramCache()), 1946 : cache_(new MockProgramCache()),
1946 vertex_shader_(NULL), 1947 vertex_shader_(NULL),
1947 fragment_shader_(NULL), 1948 fragment_shader_(NULL),
1948 program_(NULL) { 1949 program_(NULL) {
1949 } 1950 }
1950 1951
1951 protected: 1952 protected:
1952 void SetupProgramManager() override { 1953 void SetupProgramManager() override {
1953 manager_.reset(new ProgramManager(cache_.get(), kMaxVaryingVectors, 1954 manager_.reset(new ProgramManager(cache_.get(), kMaxVaryingVectors,
1955 kMaxDrawBuffers,
1954 kMaxDualSourceDrawBuffers, 1956 kMaxDualSourceDrawBuffers,
1955 gpu_preferences_, 1957 gpu_preferences_,
1956 feature_info_.get())); 1958 feature_info_.get()));
1957 } 1959 }
1958 1960
1959 void SetUp() override { 1961 void SetUp() override {
1960 ProgramManagerTestBase::SetUp(); 1962 ProgramManagerTestBase::SetUp();
1961 1963
1962 vertex_shader_ = shader_manager_.CreateShader( 1964 vertex_shader_ = shader_manager_.CreateShader(
1963 kVertexShaderClientId, kVertexShaderServiceId, GL_VERTEX_SHADER); 1965 kVertexShaderClientId, kVertexShaderServiceId, GL_VERTEX_SHADER);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 ProgramManagerDualSourceBlendingES2Test, 2400 ProgramManagerDualSourceBlendingES2Test,
2399 testing::Values( 2401 testing::Values(
2400 make_gl_ext_tuple("3.2", 2402 make_gl_ext_tuple("3.2",
2401 "GL_ARB_draw_buffers GL_ARB_blend_func_extended " 2403 "GL_ARB_draw_buffers GL_ARB_blend_func_extended "
2402 "GL_ARB_program_interface_query"), 2404 "GL_ARB_program_interface_query"),
2403 make_gl_ext_tuple("opengl es 3.1", 2405 make_gl_ext_tuple("opengl es 3.1",
2404 "GL_EXT_draw_buffers GL_EXT_blend_func_extended"))); 2406 "GL_EXT_draw_buffers GL_EXT_blend_func_extended")));
2405 2407
2406 } // namespace gles2 2408 } // namespace gles2
2407 } // namespace gpu 2409 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698