OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gles2_conform_support/egl/display.h" | 5 #include "gpu/gles2_conform_support/egl/display.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "gpu/command_buffer/client/gles2_lib.h" | 8 #include "gpu/command_buffer/client/gles2_lib.h" |
9 #include "gpu/command_buffer/service/context_group.h" | 9 #include "gpu/command_buffer/service/context_group.h" |
10 #include "gpu/gles2_conform_support/egl/config.h" | 10 #include "gpu/gles2_conform_support/egl/config.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 110 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
111 decoder_.get(), | 111 decoder_.get(), |
112 NULL)); | 112 NULL)); |
113 | 113 |
114 decoder_->set_engine(gpu_scheduler_.get()); | 114 decoder_->set_engine(gpu_scheduler_.get()); |
115 | 115 |
116 gl_surface_ = gfx::GLSurface::CreateViewGLSurface(false, win); | 116 gl_surface_ = gfx::GLSurface::CreateViewGLSurface(false, win); |
117 if (!gl_surface_.get()) | 117 if (!gl_surface_.get()) |
118 return EGL_NO_SURFACE; | 118 return EGL_NO_SURFACE; |
119 | 119 |
120 gl_context_ = gfx::GLContext::CreateGLContext(NULL, gl_surface_.get()); | 120 gl_context_ = gfx::GLContext::CreateGLContext(NULL, |
| 121 gl_surface_.get(), |
| 122 gfx::PreferDiscreteGpu); |
121 if (!gl_context_.get()) | 123 if (!gl_context_.get()) |
122 return EGL_NO_SURFACE; | 124 return EGL_NO_SURFACE; |
123 | 125 |
124 std::vector<int32> attribs; | 126 std::vector<int32> attribs; |
125 if (!decoder_->Initialize(gl_surface_.get(), | 127 if (!decoder_->Initialize(gl_surface_.get(), |
126 gl_context_.get(), | 128 gl_context_.get(), |
127 gfx::Size(), | 129 gfx::Size(), |
128 gpu::gles2::DisallowedFeatures(), | 130 gpu::gles2::DisallowedFeatures(), |
129 NULL, | 131 NULL, |
130 attribs)) { | 132 attribs)) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } else { | 197 } else { |
196 DCHECK(IsValidSurface(draw)); | 198 DCHECK(IsValidSurface(draw)); |
197 DCHECK(IsValidSurface(read)); | 199 DCHECK(IsValidSurface(read)); |
198 DCHECK(IsValidContext(ctx)); | 200 DCHECK(IsValidContext(ctx)); |
199 gles2::SetGLContext(context_.get()); | 201 gles2::SetGLContext(context_.get()); |
200 } | 202 } |
201 return true; | 203 return true; |
202 } | 204 } |
203 | 205 |
204 } // namespace egl | 206 } // namespace egl |
OLD | NEW |