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 "gpu/command_buffer/service/gl_context_virtual.h" | 5 #include "gpu/command_buffer/service/gl_context_virtual.h" |
6 | 6 |
7 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" | 7 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" |
8 #include "gpu/command_buffer/service/gpu_service_test.h" | 8 #include "gpu/command_buffer/service/gpu_service_test.h" |
9 #include "ui/gl/gl_context_stub.h" | 9 #include "ui/gl/gl_context_stub.h" |
10 #include "ui/gl/gl_share_group.h" | 10 #include "ui/gl/gl_share_group.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 EXPECT_CALL(*gl_, GetError()) | 32 EXPECT_CALL(*gl_, GetError()) |
33 .Times(AnyNumber()) | 33 .Times(AnyNumber()) |
34 .WillRepeatedly(Return(GL_NO_ERROR)); | 34 .WillRepeatedly(Return(GL_NO_ERROR)); |
35 EXPECT_CALL(*gl_, GetString(GL_VERSION)) | 35 EXPECT_CALL(*gl_, GetString(GL_VERSION)) |
36 .Times(AnyNumber()) | 36 .Times(AnyNumber()) |
37 .WillRepeatedly(Return(reinterpret_cast<unsigned const char *>("2.0"))); | 37 .WillRepeatedly(Return(reinterpret_cast<unsigned const char *>("2.0"))); |
38 EXPECT_CALL(*gl_, GetString(GL_EXTENSIONS)) | 38 EXPECT_CALL(*gl_, GetString(GL_EXTENSIONS)) |
39 .Times(AnyNumber()) | 39 .Times(AnyNumber()) |
40 .WillRepeatedly(Return(reinterpret_cast<unsigned const char *>(""))); | 40 .WillRepeatedly(Return(reinterpret_cast<unsigned const char *>(""))); |
41 { | 41 { |
42 scoped_refptr<gfx::GLContextStub> base_context = new gfx::GLContextStub; | 42 scoped_refptr<gl::GLContextStub> base_context = new gl::GLContextStub; |
43 gfx::GLShareGroup* share_group = base_context->share_group(); | 43 gl::GLShareGroup* share_group = base_context->share_group(); |
44 share_group->SetSharedContext(base_context.get()); | 44 share_group->SetSharedContext(base_context.get()); |
45 scoped_refptr<GLContextVirtual> context(new GLContextVirtual( | 45 scoped_refptr<GLContextVirtual> context(new GLContextVirtual( |
46 share_group, base_context.get(), decoder_->AsWeakPtr())); | 46 share_group, base_context.get(), decoder_->AsWeakPtr())); |
47 EXPECT_TRUE(context->Initialize(GetGLSurface(), gfx::PreferIntegratedGpu)); | 47 EXPECT_TRUE(context->Initialize(GetGLSurface(), gl::PreferIntegratedGpu)); |
48 EXPECT_TRUE(context->MakeCurrent(GetGLSurface())); | 48 EXPECT_TRUE(context->MakeCurrent(GetGLSurface())); |
49 } | 49 } |
50 { | 50 { |
51 scoped_refptr<gfx::GLContextStub> base_context = new gfx::GLContextStub; | 51 scoped_refptr<gl::GLContextStub> base_context = new gl::GLContextStub; |
52 gfx::GLShareGroup* share_group = base_context->share_group(); | 52 gl::GLShareGroup* share_group = base_context->share_group(); |
53 share_group->SetSharedContext(base_context.get()); | 53 share_group->SetSharedContext(base_context.get()); |
54 scoped_refptr<GLContextVirtual> context(new GLContextVirtual( | 54 scoped_refptr<GLContextVirtual> context(new GLContextVirtual( |
55 share_group, base_context.get(), decoder_->AsWeakPtr())); | 55 share_group, base_context.get(), decoder_->AsWeakPtr())); |
56 EXPECT_TRUE(context->Initialize(GetGLSurface(), gfx::PreferIntegratedGpu)); | 56 EXPECT_TRUE(context->Initialize(GetGLSurface(), gl::PreferIntegratedGpu)); |
57 EXPECT_TRUE(context->MakeCurrent(GetGLSurface())); | 57 EXPECT_TRUE(context->MakeCurrent(GetGLSurface())); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 } // anonymous namespace | 61 } // anonymous namespace |
62 } // namespace gles2 | 62 } // namespace gles2 |
63 } // namespace gpu | 63 } // namespace gpu |
OLD | NEW |