| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/gpu/client/context_provider_command_buffer.h" | 5 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 attributes_.lose_context_when_out_of_memory, support_client_side_arrays, | 285 attributes_.lose_context_when_out_of_memory, support_client_side_arrays, |
| 286 command_buffer_.get())); | 286 command_buffer_.get())); |
| 287 if (!gles2_impl_->Initialize(memory_limits_.start_transfer_buffer_size, | 287 if (!gles2_impl_->Initialize(memory_limits_.start_transfer_buffer_size, |
| 288 memory_limits_.min_transfer_buffer_size, | 288 memory_limits_.min_transfer_buffer_size, |
| 289 memory_limits_.max_transfer_buffer_size, | 289 memory_limits_.max_transfer_buffer_size, |
| 290 memory_limits_.mapped_memory_reclaim_limit)) { | 290 memory_limits_.mapped_memory_reclaim_limit)) { |
| 291 DLOG(ERROR) << "Failed to initialize GLES2Implementation."; | 291 DLOG(ERROR) << "Failed to initialize GLES2Implementation."; |
| 292 return false; | 292 return false; |
| 293 } | 293 } |
| 294 | 294 |
| 295 if (command_buffer_->GetLastError() != gpu::error::kNoError) { | 295 if (command_buffer_->GetLastState().error != gpu::error::kNoError) { |
| 296 DLOG(ERROR) << "Context dead on arrival. Last error: " | 296 DLOG(ERROR) << "Context dead on arrival. Last error: " |
| 297 << command_buffer_->GetLastError(); | 297 << command_buffer_->GetLastState().error; |
| 298 return false; | 298 return false; |
| 299 } | 299 } |
| 300 | 300 |
| 301 // If any context in the share group has been lost, then abort and don't | 301 // If any context in the share group has been lost, then abort and don't |
| 302 // continue since we need to go back to the caller of the constructor to | 302 // continue since we need to go back to the caller of the constructor to |
| 303 // find the correct share group. | 303 // find the correct share group. |
| 304 // This may happen in between the share group being chosen at the | 304 // This may happen in between the share group being chosen at the |
| 305 // constructor, and getting to run this BindToCurrentThread method which | 305 // constructor, and getting to run this BindToCurrentThread method which |
| 306 // can be on some other thread. | 306 // can be on some other thread. |
| 307 // We intentionally call this *after* creating the command buffer via the | 307 // We intentionally call this *after* creating the command buffer via the |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 456 |
| 457 context_thread_checker_.DetachFromThread(); | 457 context_thread_checker_.DetachFromThread(); |
| 458 SkiaGpuTraceMemoryDump trace_memory_dump( | 458 SkiaGpuTraceMemoryDump trace_memory_dump( |
| 459 pmd, gles2_impl_->ShareGroupTracingGUID()); | 459 pmd, gles2_impl_->ShareGroupTracingGUID()); |
| 460 gr_context_->get()->dumpMemoryStatistics(&trace_memory_dump); | 460 gr_context_->get()->dumpMemoryStatistics(&trace_memory_dump); |
| 461 context_thread_checker_.DetachFromThread(); | 461 context_thread_checker_.DetachFromThread(); |
| 462 return true; | 462 return true; |
| 463 } | 463 } |
| 464 | 464 |
| 465 } // namespace content | 465 } // namespace content |
| OLD | NEW |