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

Side by Side Diff: gpu/command_buffer/tests/gl_cube_map_texture_unittest.cc

Issue 1871613002: Compute GpuDriverBugWorkarounds only one time in the GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 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 <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "gpu/command_buffer/tests/gl_manager.h" 10 #include "gpu/command_buffer/tests/gl_manager.h"
(...skipping 13 matching lines...) Expand all
24 24
25 // A collection of tests that exercise the cube map texture. 25 // A collection of tests that exercise the cube map texture.
26 class GLCubeMapTextureTest : public testing::TestWithParam<GLenum> { 26 class GLCubeMapTextureTest : public testing::TestWithParam<GLenum> {
27 protected: 27 protected:
28 void SetUp() override { 28 void SetUp() override {
29 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); 29 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
30 // ANGLE and NVidia fails ReadPixelsFromIncompleteCubeTexture without this 30 // ANGLE and NVidia fails ReadPixelsFromIncompleteCubeTexture without this
31 // workaround. 31 // workaround.
32 command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, 32 command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds,
33 base::IntToString(gpu::FORCE_CUBE_COMPLETE)); 33 base::IntToString(gpu::FORCE_CUBE_COMPLETE));
34 gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); 34 gl_.InitializeWithCommandLine(GLManager::Options(), command_line);
35 DCHECK(gl_.workarounds().force_cube_complete); 35 DCHECK(gl_.workarounds().force_cube_complete);
36 for (int i = 0; i < 256; i++) { 36 for (int i = 0; i < 256; i++) {
37 pixels_[i * 4] = 255u; 37 pixels_[i * 4] = 255u;
38 pixels_[(i * 4) + 1] = 0; 38 pixels_[(i * 4) + 1] = 0;
39 pixels_[(i * 4) + 2] = 0; 39 pixels_[(i * 4) + 2] = 0;
40 pixels_[(i * 4) + 3] = 255u; 40 pixels_[(i * 4) + 3] = 255u;
41 } 41 }
42 42
43 glGenTextures(1, &texture_); 43 glGenTextures(1, &texture_);
44 glBindTexture(GL_TEXTURE_CUBE_MAP, texture_); 44 glBindTexture(GL_TEXTURE_CUBE_MAP, texture_);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT), 135 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT),
136 glCheckFramebufferStatus(GL_FRAMEBUFFER)); 136 glCheckFramebufferStatus(GL_FRAMEBUFFER));
137 GLsizei size = width_ * width_ * 4; 137 GLsizei size = width_ * width_ * 4;
138 scoped_ptr<uint8_t[]> pixels(new uint8_t[size]); 138 scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
139 glReadPixels(0, 0, width_, width_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); 139 glReadPixels(0, 0, width_, width_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
140 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_FRAMEBUFFER_OPERATION), 140 EXPECT_EQ(static_cast<GLenum>(GL_INVALID_FRAMEBUFFER_OPERATION),
141 glGetError()); 141 glGetError());
142 } 142 }
143 143
144 } // namespace gpu 144 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698