| OLD | NEW |
| 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 Loading... |
| 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; |
| 47 | 48 |
| 48 GLManager gl; | 49 GLManager gl; |
| 49 gl.Initialize(options); | 50 gl.Initialize(options); |
| 50 gl.MakeCurrent(); | 51 gl.MakeCurrent(); |
| 51 | 52 |
| 52 glResizeCHROMIUM(10, 10, 1, true); | 53 glResizeCHROMIUM(10, 10, 1, true); |
| 53 glClearColor(0.0f, 0.25f, 0.5f, 0.7f); | 54 glClearColor(0.0f, 0.25f, 0.5f, 0.7f); |
| 54 glClear(GL_COLOR_BUFFER_BIT); | 55 glClear(GL_COLOR_BUFFER_BIT); |
| 55 | 56 |
| 56 uint8_t pixel[4]; | 57 uint8_t pixel[4]; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 72 EXPECT_NEAR(76u, pixel[2], 2); | 73 EXPECT_NEAR(76u, pixel[2], 2); |
| 73 uint8_t alpha2 = has_alpha ? 102 : 255; | 74 uint8_t alpha2 = has_alpha ? 102 : 255; |
| 74 EXPECT_NEAR(alpha2, pixel[3], 2); | 75 EXPECT_NEAR(alpha2, pixel[3], 2); |
| 75 | 76 |
| 76 gl.Destroy(); | 77 gl.Destroy(); |
| 77 } | 78 } |
| 78 } | 79 } |
| 79 } | 80 } |
| 80 | 81 |
| 81 } // namespace gpu | 82 } // namespace gpu |
| OLD | NEW |