| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 context_.reset(new gpu::gles2::GLES2Implementation( | 227 context_.reset(new gpu::gles2::GLES2Implementation( |
| 228 gles2_cmd_helper_.get(), | 228 gles2_cmd_helper_.get(), |
| 229 NULL, | 229 NULL, |
| 230 transfer_buffer_.get(), | 230 transfer_buffer_.get(), |
| 231 true, | 231 true, |
| 232 NULL)); | 232 NULL)); |
| 233 | 233 |
| 234 if (!context_->Initialize( | 234 if (!context_->Initialize( |
| 235 kTransferBufferSize, | 235 kTransferBufferSize, |
| 236 kTransferBufferSize / 2, | 236 kTransferBufferSize / 2, |
| 237 kTransferBufferSize * 2)) { | 237 kTransferBufferSize * 2, |
| 238 gpu::gles2::GLES2Implementation::kNoLimit)) { |
| 238 return EGL_NO_CONTEXT; | 239 return EGL_NO_CONTEXT; |
| 239 } | 240 } |
| 240 | 241 |
| 241 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); | 242 context_->EnableFeatureCHROMIUM("pepper3d_allow_buffers_on_multiple_targets"); |
| 242 context_->EnableFeatureCHROMIUM("pepper3d_support_fixed_attribs"); | 243 context_->EnableFeatureCHROMIUM("pepper3d_support_fixed_attribs"); |
| 243 | 244 |
| 244 return context_.get(); | 245 return context_.get(); |
| 245 } | 246 } |
| 246 | 247 |
| 247 void Display::DestroyContext(EGLContext ctx) { | 248 void Display::DestroyContext(EGLContext ctx) { |
| 248 DCHECK(IsValidContext(ctx)); | 249 DCHECK(IsValidContext(ctx)); |
| 249 context_.reset(); | 250 context_.reset(); |
| 250 transfer_buffer_.reset(); | 251 transfer_buffer_.reset(); |
| 251 } | 252 } |
| 252 | 253 |
| 253 bool Display::MakeCurrent(EGLSurface draw, EGLSurface read, EGLContext ctx) { | 254 bool Display::MakeCurrent(EGLSurface draw, EGLSurface read, EGLContext ctx) { |
| 254 if (ctx == EGL_NO_CONTEXT) { | 255 if (ctx == EGL_NO_CONTEXT) { |
| 255 gles2::SetGLContext(NULL); | 256 gles2::SetGLContext(NULL); |
| 256 } else { | 257 } else { |
| 257 DCHECK(IsValidSurface(draw)); | 258 DCHECK(IsValidSurface(draw)); |
| 258 DCHECK(IsValidSurface(read)); | 259 DCHECK(IsValidSurface(read)); |
| 259 DCHECK(IsValidContext(ctx)); | 260 DCHECK(IsValidContext(ctx)); |
| 260 gles2::SetGLContext(context_.get()); | 261 gles2::SetGLContext(context_.get()); |
| 261 } | 262 } |
| 262 return true; | 263 return true; |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace egl | 266 } // namespace egl |
| OLD | NEW |