| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 DCHECK(IsValidConfig(config)); | 169 DCHECK(IsValidConfig(config)); |
| 170 // TODO(alokp): Add support for shared contexts. | 170 // TODO(alokp): Add support for shared contexts. |
| 171 if (share_ctx != NULL) | 171 if (share_ctx != NULL) |
| 172 return EGL_NO_CONTEXT; | 172 return EGL_NO_CONTEXT; |
| 173 | 173 |
| 174 DCHECK(command_buffer_ != NULL); | 174 DCHECK(command_buffer_ != NULL); |
| 175 DCHECK(transfer_buffer_.get()); | 175 DCHECK(transfer_buffer_.get()); |
| 176 bool share_resources = share_ctx != NULL; | 176 bool share_resources = share_ctx != NULL; |
| 177 context_.reset(new gpu::gles2::GLES2Implementation( | 177 context_.reset(new gpu::gles2::GLES2Implementation( |
| 178 gles2_cmd_helper_.get(), | 178 gles2_cmd_helper_.get(), |
| 179 NULL, |
| 179 transfer_buffer_.get(), | 180 transfer_buffer_.get(), |
| 180 share_resources, | 181 share_resources, |
| 181 true)); | 182 true)); |
| 182 | 183 |
| 183 if (!context_->Initialize( | 184 if (!context_->Initialize( |
| 184 kTransferBufferSize, | 185 kTransferBufferSize, |
| 185 kTransferBufferSize / 2, | 186 kTransferBufferSize / 2, |
| 186 kTransferBufferSize * 2)) { | 187 kTransferBufferSize * 2)) { |
| 187 return EGL_NO_CONTEXT; | 188 return EGL_NO_CONTEXT; |
| 188 } | 189 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 205 } else { | 206 } else { |
| 206 DCHECK(IsValidSurface(draw)); | 207 DCHECK(IsValidSurface(draw)); |
| 207 DCHECK(IsValidSurface(read)); | 208 DCHECK(IsValidSurface(read)); |
| 208 DCHECK(IsValidContext(ctx)); | 209 DCHECK(IsValidContext(ctx)); |
| 209 gles2::SetGLContext(context_.get()); | 210 gles2::SetGLContext(context_.get()); |
| 210 } | 211 } |
| 211 return true; | 212 return true; |
| 212 } | 213 } |
| 213 | 214 |
| 214 } // namespace egl | 215 } // namespace egl |
| OLD | NEW |