| 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 // This file contains the implementation of the command buffer helper class. | 5 // This file contains the implementation of the command buffer helper class. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 7 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #endif | 36 #endif |
| 37 usable_(true), | 37 usable_(true), |
| 38 context_lost_(false), | 38 context_lost_(false), |
| 39 flush_automatically_(true), | 39 flush_automatically_(true), |
| 40 flush_generation_(0) { | 40 flush_generation_(0) { |
| 41 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). | 41 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). |
| 42 // Don't register a dump provider in these cases. | 42 // Don't register a dump provider in these cases. |
| 43 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 | 43 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 |
| 44 if (base::ThreadTaskRunnerHandle::IsSet()) { | 44 if (base::ThreadTaskRunnerHandle::IsSet()) { |
| 45 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 45 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 46 this, base::ThreadTaskRunnerHandle::Get()); | 46 this, "gpu::CommandBufferHelper", base::ThreadTaskRunnerHandle::Get()); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 void CommandBufferHelper::SetAutomaticFlushes(bool enabled) { | 50 void CommandBufferHelper::SetAutomaticFlushes(bool enabled) { |
| 51 flush_automatically_ = enabled; | 51 flush_automatically_ = enabled; |
| 52 CalcImmediateEntries(0); | 52 CalcImmediateEntries(0); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool CommandBufferHelper::IsContextLost() { | 55 bool CommandBufferHelper::IsContextLost() { |
| 56 if (!context_lost_) { | 56 if (!context_lost_) { |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 GetTotalFreeEntriesNoWaiting() * sizeof(CommandBufferEntry)); | 353 GetTotalFreeEntriesNoWaiting() * sizeof(CommandBufferEntry)); |
| 354 auto guid = GetBufferGUIDForTracing(tracing_process_id, ring_buffer_id_); | 354 auto guid = GetBufferGUIDForTracing(tracing_process_id, ring_buffer_id_); |
| 355 const int kImportance = 2; | 355 const int kImportance = 2; |
| 356 pmd->CreateSharedGlobalAllocatorDump(guid); | 356 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 357 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 357 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 358 | 358 |
| 359 return true; | 359 return true; |
| 360 } | 360 } |
| 361 | 361 |
| 362 } // namespace gpu | 362 } // namespace gpu |
| OLD | NEW |