OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/context.h" | 5 #include "gpu/gles2_conform_support/egl/context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 gpu::gles2::ContextCreationAttribHelper helper; | 288 gpu::gles2::ContextCreationAttribHelper helper; |
289 config_->GetAttrib(EGL_ALPHA_SIZE, &helper.alpha_size); | 289 config_->GetAttrib(EGL_ALPHA_SIZE, &helper.alpha_size); |
290 config_->GetAttrib(EGL_DEPTH_SIZE, &helper.depth_size); | 290 config_->GetAttrib(EGL_DEPTH_SIZE, &helper.depth_size); |
291 config_->GetAttrib(EGL_STENCIL_SIZE, &helper.stencil_size); | 291 config_->GetAttrib(EGL_STENCIL_SIZE, &helper.stencil_size); |
292 | 292 |
293 helper.buffer_preserved = false; | 293 helper.buffer_preserved = false; |
294 helper.bind_generates_resource = kBindGeneratesResources; | 294 helper.bind_generates_resource = kBindGeneratesResources; |
295 helper.fail_if_major_perf_caveat = false; | 295 helper.fail_if_major_perf_caveat = false; |
296 helper.lose_context_when_out_of_memory = kLoseContextWhenOutOfMemory; | 296 helper.lose_context_when_out_of_memory = kLoseContextWhenOutOfMemory; |
297 helper.context_type = gpu::gles2::CONTEXT_TYPE_OPENGLES2; | 297 helper.context_type = gpu::gles2::CONTEXT_TYPE_OPENGLES2; |
298 helper.offscreen_framebuffer_size = gl_surface->GetSize(); | |
299 | 298 |
300 if (!decoder->Initialize(gl_surface, gl_context.get(), | 299 if (!decoder->Initialize(gl_surface, gl_context.get(), |
301 gl_surface->IsOffscreen(), | 300 gl_surface->IsOffscreen(), gl_surface->GetSize(), |
302 gpu::gles2::DisallowedFeatures(), helper)) { | 301 gpu::gles2::DisallowedFeatures(), helper)) { |
303 return false; | 302 return false; |
304 } | 303 } |
305 | 304 |
306 command_buffer->SetPutOffsetChangeCallback( | 305 command_buffer->SetPutOffsetChangeCallback( |
307 base::Bind(&gpu::CommandExecutor::PutChanged, | 306 base::Bind(&gpu::CommandExecutor::PutChanged, |
308 base::Unretained(command_executor.get()))); | 307 base::Unretained(command_executor.get()))); |
309 command_buffer->SetGetBufferChangeCallback( | 308 command_buffer->SetGetBufferChangeCallback( |
310 base::Bind(&gpu::CommandExecutor::SetGetBuffer, | 309 base::Bind(&gpu::CommandExecutor::SetGetBuffer, |
311 base::Unretained(command_executor.get()))); | 310 base::Unretained(command_executor.get()))); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 return false; | 392 return false; |
394 if (!gl_context_->MakeCurrent(gl_surface)) { | 393 if (!gl_context_->MakeCurrent(gl_surface)) { |
395 MarkServiceContextLost(); | 394 MarkServiceContextLost(); |
396 return false; | 395 return false; |
397 } | 396 } |
398 client_gl_context_->Flush(); | 397 client_gl_context_->Flush(); |
399 return true; | 398 return true; |
400 } | 399 } |
401 | 400 |
402 } // namespace egl | 401 } // namespace egl |
OLD | NEW |