OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 | 7 |
8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "gpu/command_buffer/tests/gl_manager.h" | 13 #include "gpu/command_buffer/tests/gl_manager.h" |
14 #include "gpu/command_buffer/tests/gl_test_utils.h" | 14 #include "gpu/command_buffer/tests/gl_test_utils.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
18 #include "ui/gl/android/surface_texture.h" | 18 #include "ui/gl/android/surface_texture.h" |
19 #include "ui/gl/gl_surface.h" | 19 #include "ui/gl/gl_surface.h" |
20 | 20 |
21 namespace gpu { | 21 namespace gpu { |
22 | 22 |
23 class GLSurfaceTextureTest : public testing::Test { | 23 class GLSurfaceTextureTest : public testing::Test { |
24 protected: | 24 protected: |
25 virtual void SetUp() override { | 25 void SetUp() override { gl_.Initialize(GLManager::Options()); } |
26 gl_.Initialize(GLManager::Options()); | |
27 } | |
28 | 26 |
29 virtual void TearDown() override { | 27 void TearDown() override { gl_.Destroy(); } |
30 gl_.Destroy(); | |
31 } | |
32 | 28 |
33 GLManager gl_; | 29 GLManager gl_; |
34 }; | 30 }; |
35 | 31 |
36 TEST_F(GLSurfaceTextureTest, SimpleTest) { | 32 TEST_F(GLSurfaceTextureTest, SimpleTest) { |
37 // TODO(sievers): Eliminate the need for this by using a client-side | 33 // TODO(sievers): Eliminate the need for this by using a client-side |
38 // abstraction for the SurfaceTexture in this test. | 34 // abstraction for the SurfaceTexture in this test. |
39 GLuint texture = 0xFEEDBEEF; | 35 GLuint texture = 0xFEEDBEEF; |
40 | 36 |
41 scoped_refptr<gfx::SurfaceTexture> surface_texture( | 37 scoped_refptr<gfx::SurfaceTexture> surface_texture( |
(...skipping 13 matching lines...) Expand all Loading... |
55 | 51 |
56 surface_texture->UpdateTexImage(); | 52 surface_texture->UpdateTexImage(); |
57 | 53 |
58 GLTestHelper::CheckGLError("no errors", __LINE__); | 54 GLTestHelper::CheckGLError("no errors", __LINE__); |
59 | 55 |
60 ANativeWindow_release(window); | 56 ANativeWindow_release(window); |
61 } | 57 } |
62 | 58 |
63 } // namespace gpu | 59 } // namespace gpu |
64 | 60 |
OLD | NEW |