OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "gpu/command_buffer/client/gles2_lib.h" | 10 #include "gpu/command_buffer/client/gles2_lib.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 136 } |
137 if (!gl_surface_.get()) | 137 if (!gl_surface_.get()) |
138 return EGL_NO_SURFACE; | 138 return EGL_NO_SURFACE; |
139 | 139 |
140 gl_context_ = gfx::GLContext::CreateGLContext(NULL, | 140 gl_context_ = gfx::GLContext::CreateGLContext(NULL, |
141 gl_surface_.get(), | 141 gl_surface_.get(), |
142 gfx::PreferDiscreteGpu); | 142 gfx::PreferDiscreteGpu); |
143 if (!gl_context_.get()) | 143 if (!gl_context_.get()) |
144 return EGL_NO_SURFACE; | 144 return EGL_NO_SURFACE; |
145 | 145 |
146 gl_context_->MakeCurrent(gl_surface_); | 146 gl_context_->MakeCurrent(gl_surface_.get()); |
147 | 147 |
148 EGLint depth_size = 0; | 148 EGLint depth_size = 0; |
149 EGLint alpha_size = 0; | 149 EGLint alpha_size = 0; |
150 EGLint stencil_size = 0; | 150 EGLint stencil_size = 0; |
151 GetConfigAttrib(config, EGL_DEPTH_SIZE, &depth_size); | 151 GetConfigAttrib(config, EGL_DEPTH_SIZE, &depth_size); |
152 GetConfigAttrib(config, EGL_ALPHA_SIZE, &alpha_size); | 152 GetConfigAttrib(config, EGL_ALPHA_SIZE, &alpha_size); |
153 GetConfigAttrib(config, EGL_STENCIL_SIZE, &stencil_size); | 153 GetConfigAttrib(config, EGL_STENCIL_SIZE, &stencil_size); |
154 std::vector<int32> attribs; | 154 std::vector<int32> attribs; |
155 attribs.push_back(EGL_DEPTH_SIZE); | 155 attribs.push_back(EGL_DEPTH_SIZE); |
156 attribs.push_back(depth_size); | 156 attribs.push_back(depth_size); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } else { | 258 } else { |
259 DCHECK(IsValidSurface(draw)); | 259 DCHECK(IsValidSurface(draw)); |
260 DCHECK(IsValidSurface(read)); | 260 DCHECK(IsValidSurface(read)); |
261 DCHECK(IsValidContext(ctx)); | 261 DCHECK(IsValidContext(ctx)); |
262 gles2::SetGLContext(context_.get()); | 262 gles2::SetGLContext(context_.get()); |
263 } | 263 } |
264 return true; | 264 return true; |
265 } | 265 } |
266 | 266 |
267 } // namespace egl | 267 } // namespace egl |
OLD | NEW |