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 <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
7 #include <vector> | 10 #include <vector> |
8 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
9 #include "base/bind.h" | 12 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
11 #include "gpu/command_buffer/client/gles2_implementation.h" | 14 #include "gpu/command_buffer/client/gles2_implementation.h" |
12 #include "gpu/command_buffer/client/gles2_lib.h" | 15 #include "gpu/command_buffer/client/gles2_lib.h" |
13 #include "gpu/command_buffer/client/transfer_buffer.h" | 16 #include "gpu/command_buffer/client/transfer_buffer.h" |
14 #include "gpu/command_buffer/common/value_state.h" | 17 #include "gpu/command_buffer/common/value_state.h" |
15 #include "gpu/command_buffer/service/context_group.h" | 18 #include "gpu/command_buffer/service/context_group.h" |
16 #include "gpu/command_buffer/service/mailbox_manager.h" | 19 #include "gpu/command_buffer/service/mailbox_manager.h" |
17 #include "gpu/command_buffer/service/memory_tracking.h" | 20 #include "gpu/command_buffer/service/memory_tracking.h" |
18 #include "gpu/command_buffer/service/transfer_buffer_manager.h" | 21 #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
19 #include "gpu/command_buffer/service/valuebuffer_manager.h" | 22 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
20 #include "gpu/gles2_conform_support/egl/config.h" | 23 #include "gpu/gles2_conform_support/egl/config.h" |
21 #include "gpu/gles2_conform_support/egl/surface.h" | 24 #include "gpu/gles2_conform_support/egl/surface.h" |
22 | 25 |
23 namespace { | 26 namespace { |
24 const int32 kCommandBufferSize = 1024 * 1024; | 27 const int32_t kCommandBufferSize = 1024 * 1024; |
25 const int32 kTransferBufferSize = 512 * 1024; | 28 const int32_t kTransferBufferSize = 512 * 1024; |
26 } | 29 } |
27 | 30 |
28 namespace egl { | 31 namespace egl { |
29 | 32 |
30 Display::Display(EGLNativeDisplayType display_id) | 33 Display::Display(EGLNativeDisplayType display_id) |
31 : display_id_(display_id), | 34 : display_id_(display_id), |
32 is_initialized_(false), | 35 is_initialized_(false), |
33 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) | 36 #if defined(COMMAND_BUFFER_GLES_LIB_SUPPORT_ONLY) |
34 exit_manager_(new base::AtExitManager), | 37 exit_manager_(new base::AtExitManager), |
35 #endif | 38 #endif |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return EGL_NO_SURFACE; | 157 return EGL_NO_SURFACE; |
155 | 158 |
156 gl_context_->MakeCurrent(gl_surface_.get()); | 159 gl_context_->MakeCurrent(gl_surface_.get()); |
157 | 160 |
158 EGLint depth_size = 0; | 161 EGLint depth_size = 0; |
159 EGLint alpha_size = 0; | 162 EGLint alpha_size = 0; |
160 EGLint stencil_size = 0; | 163 EGLint stencil_size = 0; |
161 GetConfigAttrib(config, EGL_DEPTH_SIZE, &depth_size); | 164 GetConfigAttrib(config, EGL_DEPTH_SIZE, &depth_size); |
162 GetConfigAttrib(config, EGL_ALPHA_SIZE, &alpha_size); | 165 GetConfigAttrib(config, EGL_ALPHA_SIZE, &alpha_size); |
163 GetConfigAttrib(config, EGL_STENCIL_SIZE, &stencil_size); | 166 GetConfigAttrib(config, EGL_STENCIL_SIZE, &stencil_size); |
164 std::vector<int32> attribs; | 167 std::vector<int32_t> attribs; |
165 attribs.push_back(EGL_DEPTH_SIZE); | 168 attribs.push_back(EGL_DEPTH_SIZE); |
166 attribs.push_back(depth_size); | 169 attribs.push_back(depth_size); |
167 attribs.push_back(EGL_ALPHA_SIZE); | 170 attribs.push_back(EGL_ALPHA_SIZE); |
168 attribs.push_back(alpha_size); | 171 attribs.push_back(alpha_size); |
169 attribs.push_back(EGL_STENCIL_SIZE); | 172 attribs.push_back(EGL_STENCIL_SIZE); |
170 attribs.push_back(stencil_size); | 173 attribs.push_back(stencil_size); |
171 // TODO(gman): Insert attrib_list. Although ES 1.1 says it must be null | 174 // TODO(gman): Insert attrib_list. Although ES 1.1 says it must be null |
172 attribs.push_back(EGL_NONE); | 175 attribs.push_back(EGL_NONE); |
173 | 176 |
174 if (!decoder_->Initialize(gl_surface_.get(), | 177 if (!decoder_->Initialize(gl_surface_.get(), |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 289 } |
287 | 290 |
288 int32_t Display::CreateImage(ClientBuffer buffer, | 291 int32_t Display::CreateImage(ClientBuffer buffer, |
289 size_t width, | 292 size_t width, |
290 size_t height, | 293 size_t height, |
291 unsigned internalformat) { | 294 unsigned internalformat) { |
292 NOTIMPLEMENTED(); | 295 NOTIMPLEMENTED(); |
293 return -1; | 296 return -1; |
294 } | 297 } |
295 | 298 |
296 void Display::DestroyImage(int32 id) { | 299 void Display::DestroyImage(int32_t id) { |
297 NOTIMPLEMENTED(); | 300 NOTIMPLEMENTED(); |
298 } | 301 } |
299 | 302 |
300 int32_t Display::CreateGpuMemoryBufferImage(size_t width, | 303 int32_t Display::CreateGpuMemoryBufferImage(size_t width, |
301 size_t height, | 304 size_t height, |
302 unsigned internalformat, | 305 unsigned internalformat, |
303 unsigned usage) { | 306 unsigned usage) { |
304 NOTIMPLEMENTED(); | 307 NOTIMPLEMENTED(); |
305 return -1; | 308 return -1; |
306 } | 309 } |
307 | 310 |
308 uint32 Display::InsertSyncPoint() { | 311 uint32_t Display::InsertSyncPoint() { |
309 NOTIMPLEMENTED(); | 312 NOTIMPLEMENTED(); |
310 return 0u; | 313 return 0u; |
311 } | 314 } |
312 | 315 |
313 uint32 Display::InsertFutureSyncPoint() { | 316 uint32_t Display::InsertFutureSyncPoint() { |
314 NOTIMPLEMENTED(); | 317 NOTIMPLEMENTED(); |
315 return 0u; | 318 return 0u; |
316 } | 319 } |
317 | 320 |
318 void Display::RetireSyncPoint(uint32 sync_point) { | 321 void Display::RetireSyncPoint(uint32_t sync_point) { |
319 NOTIMPLEMENTED(); | 322 NOTIMPLEMENTED(); |
320 } | 323 } |
321 | 324 |
322 void Display::SignalSyncPoint(uint32 sync_point, | 325 void Display::SignalSyncPoint(uint32_t sync_point, |
323 const base::Closure& callback) { | 326 const base::Closure& callback) { |
324 NOTIMPLEMENTED(); | 327 NOTIMPLEMENTED(); |
325 } | 328 } |
326 | 329 |
327 void Display::SignalQuery(uint32 query, const base::Closure& callback) { | 330 void Display::SignalQuery(uint32_t query, const base::Closure& callback) { |
328 NOTIMPLEMENTED(); | 331 NOTIMPLEMENTED(); |
329 } | 332 } |
330 | 333 |
331 void Display::SetLock(base::Lock*) { | 334 void Display::SetLock(base::Lock*) { |
332 NOTIMPLEMENTED(); | 335 NOTIMPLEMENTED(); |
333 } | 336 } |
334 | 337 |
335 bool Display::IsGpuChannelLost() { | 338 bool Display::IsGpuChannelLost() { |
336 NOTIMPLEMENTED(); | 339 NOTIMPLEMENTED(); |
337 return false; | 340 return false; |
(...skipping 30 matching lines...) Expand all Loading... |
368 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, | 371 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, |
369 const base::Closure& callback) { | 372 const base::Closure& callback) { |
370 NOTIMPLEMENTED(); | 373 NOTIMPLEMENTED(); |
371 } | 374 } |
372 | 375 |
373 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 376 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
374 return false; | 377 return false; |
375 } | 378 } |
376 | 379 |
377 } // namespace egl | 380 } // namespace egl |
OLD | NEW |