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

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

Issue 2121293004: Reland of Fix initialization ordering in GLES2CmdDecoder. (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
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 8
9 #include "gpu/command_buffer/client/gles2_lib.h" 9 #include "gpu/command_buffer/client/gles2_lib.h"
10 #include "gpu/command_buffer/service/image_factory.h" 10 #include "gpu/command_buffer/service/image_factory.h"
(...skipping 26 matching lines...) Expand all
37 LOG(INFO) << "GL_ARB_texture_rectangle not supported. Skipping test..."; 37 LOG(INFO) << "GL_ARB_texture_rectangle not supported. Skipping test...";
38 return; 38 return;
39 } 39 }
40 40
41 for (int has_alpha = 0; has_alpha <= 1; ++has_alpha) { 41 for (int has_alpha = 0; has_alpha <= 1; ++has_alpha) {
42 for (int msaa = 0; msaa <= 1; ++msaa) { 42 for (int msaa = 0; msaa <= 1; ++msaa) {
43 GLManager::Options options; 43 GLManager::Options options;
44 options.image_factory = &image_factory_; 44 options.image_factory = &image_factory_;
45 options.multisampled = msaa == 1; 45 options.multisampled = msaa == 1;
46 options.backbuffer_alpha = has_alpha == 1; 46 options.backbuffer_alpha = has_alpha == 1;
47 options.enable_arb_texture_rectangle = true;
48 47
49 GLManager gl; 48 GLManager gl;
50 gl.Initialize(options); 49 gl.Initialize(options);
51 gl.MakeCurrent(); 50 gl.MakeCurrent();
52 51
53 glResizeCHROMIUM(10, 10, 1, true); 52 glResizeCHROMIUM(10, 10, 1, true);
54 glClearColor(0.0f, 0.25f, 0.5f, 0.7f); 53 glClearColor(0.0f, 0.25f, 0.5f, 0.7f);
55 glClear(GL_COLOR_BUFFER_BIT); 54 glClear(GL_COLOR_BUFFER_BIT);
56 55
57 uint8_t pixel[4]; 56 uint8_t pixel[4];
(...skipping 15 matching lines...) Expand all
73 EXPECT_NEAR(76u, pixel[2], 2); 72 EXPECT_NEAR(76u, pixel[2], 2);
74 uint8_t alpha2 = has_alpha ? 102 : 255; 73 uint8_t alpha2 = has_alpha ? 102 : 255;
75 EXPECT_NEAR(alpha2, pixel[3], 2); 74 EXPECT_NEAR(alpha2, pixel[3], 2);
76 75
77 gl.Destroy(); 76 gl.Destroy();
78 } 77 }
79 } 78 }
80 } 79 }
81 80
82 } // namespace gpu 81 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698