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

Side by Side Diff: gpu/command_buffer/service/gl_context_virtual_unittest.cc

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: address piman's comments Created 4 years, 1 month 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
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 "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 26 matching lines...) Expand all
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<gl::GLContextStub> base_context = new gl::GLContextStub; 42 scoped_refptr<gl::GLContextStub> base_context = new gl::GLContextStub;
43 gl::GLShareGroup* share_group = base_context->share_group(); 43 gl::GLShareGroup* share_group = base_context->share_group();
44 share_group->SetSharedContext(GetGLSurface(), base_context.get()); 44 share_group->SetSharedContext(GetGLSurface(), 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(), gl::PreferIntegratedGpu)); 47 EXPECT_TRUE(context->Initialize(GetGLSurface(), gl::GLContextAttribs()));
48 EXPECT_TRUE(context->MakeCurrent(GetGLSurface())); 48 EXPECT_TRUE(context->MakeCurrent(GetGLSurface()));
49 } 49 }
50 { 50 {
51 scoped_refptr<gl::GLContextStub> base_context = new gl::GLContextStub; 51 scoped_refptr<gl::GLContextStub> base_context = new gl::GLContextStub;
52 gl::GLShareGroup* share_group = base_context->share_group(); 52 gl::GLShareGroup* share_group = base_context->share_group();
53 share_group->SetSharedContext(GetGLSurface(), base_context.get()); 53 share_group->SetSharedContext(GetGLSurface(), 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(), gl::PreferIntegratedGpu)); 56 EXPECT_TRUE(context->Initialize(GetGLSurface(), gl::GLContextAttribs()));
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698