| 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_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 if (!gl_surface_.get()) | 136 if (!gl_surface_.get()) |
| 137 return EGL_NO_SURFACE; | 137 return EGL_NO_SURFACE; |
| 138 | 138 |
| 139 gl_context_ = gfx::GLContext::CreateGLContext(NULL, | 139 gl_context_ = gfx::GLContext::CreateGLContext(NULL, |
| 140 gl_surface_.get(), | 140 gl_surface_.get(), |
| 141 gfx::PreferDiscreteGpu); | 141 gfx::PreferDiscreteGpu); |
| 142 if (!gl_context_.get()) | 142 if (!gl_context_.get()) |
| 143 return EGL_NO_SURFACE; | 143 return EGL_NO_SURFACE; |
| 144 | 144 |
| 145 gl_context_->MakeCurrent(gl_surface_); | 145 gl_context_->MakeCurrent(gl_surface_.get()); |
| 146 | 146 |
| 147 EGLint depth_size = 0; | 147 EGLint depth_size = 0; |
| 148 EGLint alpha_size = 0; | 148 EGLint alpha_size = 0; |
| 149 EGLint stencil_size = 0; | 149 EGLint stencil_size = 0; |
| 150 GetConfigAttrib(config, EGL_DEPTH_SIZE, &depth_size); | 150 GetConfigAttrib(config, EGL_DEPTH_SIZE, &depth_size); |
| 151 GetConfigAttrib(config, EGL_ALPHA_SIZE, &alpha_size); | 151 GetConfigAttrib(config, EGL_ALPHA_SIZE, &alpha_size); |
| 152 GetConfigAttrib(config, EGL_STENCIL_SIZE, &stencil_size); | 152 GetConfigAttrib(config, EGL_STENCIL_SIZE, &stencil_size); |
| 153 std::vector<int32> attribs; | 153 std::vector<int32> attribs; |
| 154 attribs.push_back(EGL_DEPTH_SIZE); | 154 attribs.push_back(EGL_DEPTH_SIZE); |
| 155 attribs.push_back(depth_size); | 155 attribs.push_back(depth_size); |
| (...skipping 102 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 |