| 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 12 matching lines...) Expand all Loading... |
| 23 transfer_buffer_id_(-1) { | 23 transfer_buffer_id_(-1) { |
| 24 } | 24 } |
| 25 | 25 |
| 26 Display::~Display() { | 26 Display::~Display() { |
| 27 gles2::Terminate(); | 27 gles2::Terminate(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool Display::Initialize() { | 30 bool Display::Initialize() { |
| 31 scoped_ptr<gpu::CommandBufferService> command_buffer( | 31 scoped_ptr<gpu::CommandBufferService> command_buffer( |
| 32 new gpu::CommandBufferService); | 32 new gpu::CommandBufferService); |
| 33 if (!command_buffer->Initialize(kCommandBufferSize)) | 33 if (!command_buffer->Initialize()) |
| 34 return false; | 34 return false; |
| 35 | 35 |
| 36 int32 transfer_buffer_id = | 36 int32 transfer_buffer_id = |
| 37 command_buffer->CreateTransferBuffer(kTransferBufferSize, -1); | 37 command_buffer->CreateTransferBuffer(kTransferBufferSize, -1); |
| 38 gpu::Buffer transfer_buffer = | 38 gpu::Buffer transfer_buffer = |
| 39 command_buffer->GetTransferBuffer(transfer_buffer_id); | 39 command_buffer->GetTransferBuffer(transfer_buffer_id); |
| 40 if (transfer_buffer.ptr == NULL) | 40 if (transfer_buffer.ptr == NULL) |
| 41 return false; | 41 return false; |
| 42 | 42 |
| 43 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( | 43 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } else { | 197 } else { |
| 198 DCHECK(IsValidSurface(draw)); | 198 DCHECK(IsValidSurface(draw)); |
| 199 DCHECK(IsValidSurface(read)); | 199 DCHECK(IsValidSurface(read)); |
| 200 DCHECK(IsValidContext(ctx)); | 200 DCHECK(IsValidContext(ctx)); |
| 201 gles2::SetGLContext(context_.get()); | 201 gles2::SetGLContext(context_.get()); |
| 202 } | 202 } |
| 203 return true; | 203 return true; |
| 204 } | 204 } |
| 205 | 205 |
| 206 } // namespace egl | 206 } // namespace egl |
| OLD | NEW |