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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 void TearDown() override { gl_.Destroy(); } | 28 void TearDown() override { gl_.Destroy(); } |
29 | 29 |
30 GLManager gl_; | 30 GLManager gl_; |
31 }; | 31 }; |
32 | 32 |
33 TEST_F(GLSurfaceTextureTest, SimpleTest) { | 33 TEST_F(GLSurfaceTextureTest, SimpleTest) { |
34 // TODO(sievers): Eliminate the need for this by using a client-side | 34 // TODO(sievers): Eliminate the need for this by using a client-side |
35 // abstraction for the SurfaceTexture in this test. | 35 // abstraction for the SurfaceTexture in this test. |
36 GLuint texture = 0xFEEDBEEF; | 36 GLuint texture = 0xFEEDBEEF; |
37 | 37 |
38 scoped_refptr<gfx::SurfaceTexture> surface_texture( | 38 scoped_refptr<gl::SurfaceTexture> surface_texture( |
39 gfx::SurfaceTexture::Create(texture)); | 39 gl::SurfaceTexture::Create(texture)); |
40 gfx::AcceleratedWidget window = surface_texture->CreateSurface(); | 40 gfx::AcceleratedWidget window = surface_texture->CreateSurface(); |
41 EXPECT_TRUE(window != NULL); | 41 EXPECT_TRUE(window != NULL); |
42 | 42 |
43 scoped_refptr<gfx::GLSurface> gl_surface = | 43 scoped_refptr<gl::GLSurface> gl_surface = |
44 gl::init::CreateViewGLSurface(window); | 44 gl::init::CreateViewGLSurface(window); |
45 EXPECT_TRUE(gl_surface.get() != NULL); | 45 EXPECT_TRUE(gl_surface.get() != NULL); |
46 | 46 |
47 gl_.SetSurface(gl_surface.get()); | 47 gl_.SetSurface(gl_surface.get()); |
48 | 48 |
49 glClearColor(0.0f, 1.0f, 0.0f, 1.0f); | 49 glClearColor(0.0f, 1.0f, 0.0f, 1.0f); |
50 glClear(GL_COLOR_BUFFER_BIT); | 50 glClear(GL_COLOR_BUFFER_BIT); |
51 // glSwapBuffers(); | 51 // glSwapBuffers(); |
52 | 52 |
53 surface_texture->UpdateTexImage(); | 53 surface_texture->UpdateTexImage(); |
54 | 54 |
55 GLTestHelper::CheckGLError("no errors", __LINE__); | 55 GLTestHelper::CheckGLError("no errors", __LINE__); |
56 | 56 |
57 ANativeWindow_release(window); | 57 ANativeWindow_release(window); |
58 } | 58 } |
59 | 59 |
60 } // namespace gpu | 60 } // namespace gpu |
61 | 61 |
OLD | NEW |