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