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(); |
298 | 299 |
299 if (!decoder->Initialize(gl_surface, gl_context.get(), | 300 if (!decoder->Initialize(gl_surface, gl_context.get(), |
300 gl_surface->IsOffscreen(), gl_surface->GetSize(), | 301 gl_surface->IsOffscreen(), |
301 gpu::gles2::DisallowedFeatures(), helper)) { | 302 gpu::gles2::DisallowedFeatures(), helper)) { |
302 return false; | 303 return false; |
303 } | 304 } |
304 | 305 |
305 command_buffer->SetPutOffsetChangeCallback( | 306 command_buffer->SetPutOffsetChangeCallback( |
306 base::Bind(&gpu::CommandExecutor::PutChanged, | 307 base::Bind(&gpu::CommandExecutor::PutChanged, |
307 base::Unretained(command_executor.get()))); | 308 base::Unretained(command_executor.get()))); |
308 command_buffer->SetGetBufferChangeCallback( | 309 command_buffer->SetGetBufferChangeCallback( |
309 base::Bind(&gpu::CommandExecutor::SetGetBuffer, | 310 base::Bind(&gpu::CommandExecutor::SetGetBuffer, |
310 base::Unretained(command_executor.get()))); | 311 base::Unretained(command_executor.get()))); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 return false; | 393 return false; |
393 if (!gl_context_->MakeCurrent(gl_surface)) { | 394 if (!gl_context_->MakeCurrent(gl_surface)) { |
394 MarkServiceContextLost(); | 395 MarkServiceContextLost(); |
395 return false; | 396 return false; |
396 } | 397 } |
397 client_gl_context_->Flush(); | 398 client_gl_context_->Flush(); |
398 return true; | 399 return true; |
399 } | 400 } |
400 | 401 |
401 } // namespace egl | 402 } // namespace egl |
OLD | NEW |