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" |
| 9 #include "base/bind_helpers.h" |
8 #include "gpu/command_buffer/client/gles2_lib.h" | 10 #include "gpu/command_buffer/client/gles2_lib.h" |
9 #include "gpu/command_buffer/service/context_group.h" | 11 #include "gpu/command_buffer/service/context_group.h" |
10 #include "gpu/gles2_conform_support/egl/config.h" | 12 #include "gpu/gles2_conform_support/egl/config.h" |
11 #include "gpu/gles2_conform_support/egl/surface.h" | 13 #include "gpu/gles2_conform_support/egl/surface.h" |
12 | 14 |
13 namespace { | 15 namespace { |
14 const int32 kCommandBufferSize = 1024 * 1024; | 16 const int32 kCommandBufferSize = 1024 * 1024; |
15 const int32 kTransferBufferSize = 512 * 1024; | 17 const int32 kTransferBufferSize = 512 * 1024; |
16 } | 18 } |
17 | 19 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 if (!decoder_->Initialize(gl_surface_.get(), | 129 if (!decoder_->Initialize(gl_surface_.get(), |
128 gl_context_.get(), | 130 gl_context_.get(), |
129 gfx::Size(), | 131 gfx::Size(), |
130 gpu::gles2::DisallowedFeatures(), | 132 gpu::gles2::DisallowedFeatures(), |
131 NULL, | 133 NULL, |
132 attribs)) { | 134 attribs)) { |
133 return EGL_NO_SURFACE; | 135 return EGL_NO_SURFACE; |
134 } | 136 } |
135 | 137 |
136 command_buffer_->SetPutOffsetChangeCallback( | 138 command_buffer_->SetPutOffsetChangeCallback( |
137 NewCallback(gpu_scheduler_.get(), &gpu::GpuScheduler::PutChanged)); | 139 base::Bind(&gpu::GpuScheduler::PutChanged, |
| 140 base::Unretained(gpu_scheduler_.get()))); |
138 | 141 |
139 surface_.reset(new Surface(win)); | 142 surface_.reset(new Surface(win)); |
140 | 143 |
141 return surface_.get(); | 144 return surface_.get(); |
142 } | 145 } |
143 | 146 |
144 void Display::DestroySurface(EGLSurface surface) { | 147 void Display::DestroySurface(EGLSurface surface) { |
145 DCHECK(IsValidSurface(surface)); | 148 DCHECK(IsValidSurface(surface)); |
146 gpu_scheduler_.reset(); | 149 gpu_scheduler_.reset(); |
147 decoder_.reset(); | 150 decoder_.reset(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } else { | 200 } else { |
198 DCHECK(IsValidSurface(draw)); | 201 DCHECK(IsValidSurface(draw)); |
199 DCHECK(IsValidSurface(read)); | 202 DCHECK(IsValidSurface(read)); |
200 DCHECK(IsValidContext(ctx)); | 203 DCHECK(IsValidContext(ctx)); |
201 gles2::SetGLContext(context_.get()); | 204 gles2::SetGLContext(context_.get()); |
202 } | 205 } |
203 return true; | 206 return true; |
204 } | 207 } |
205 | 208 |
206 } // namespace egl | 209 } // namespace egl |
OLD | NEW |