| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 void ResourceProvider::Initialize() { | 1031 void ResourceProvider::Initialize() { |
| 1032 DCHECK(thread_checker_.CalledOnValidThread()); | 1032 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1033 | 1033 |
| 1034 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). | 1034 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). |
| 1035 // Don't register a dump provider in these cases. | 1035 // Don't register a dump provider in these cases. |
| 1036 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 | 1036 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 |
| 1037 if (base::ThreadTaskRunnerHandle::IsSet()) { | 1037 if (base::ThreadTaskRunnerHandle::IsSet()) { |
| 1038 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 1038 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 1039 this, base::ThreadTaskRunnerHandle::Get()); | 1039 this, "cc::ResourceProvider", base::ThreadTaskRunnerHandle::Get()); |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 GLES2Interface* gl = ContextGL(); | 1042 GLES2Interface* gl = ContextGL(); |
| 1043 if (!gl) { | 1043 if (!gl) { |
| 1044 default_resource_type_ = RESOURCE_TYPE_BITMAP; | 1044 default_resource_type_ = RESOURCE_TYPE_BITMAP; |
| 1045 // Pick an arbitrary limit here similar to what hardware might. | 1045 // Pick an arbitrary limit here similar to what hardware might. |
| 1046 max_texture_size_ = 16 * 1024; | 1046 max_texture_size_ = 16 * 1024; |
| 1047 best_texture_format_ = RGBA_8888; | 1047 best_texture_format_ = RGBA_8888; |
| 1048 return; | 1048 return; |
| 1049 } | 1049 } |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1637 const int kImportance = 2; | 1637 const int kImportance = 2; |
| 1638 pmd->CreateSharedGlobalAllocatorDump(guid); | 1638 pmd->CreateSharedGlobalAllocatorDump(guid); |
| 1639 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); | 1639 pmd->AddOwnershipEdge(dump->guid(), guid, kImportance); |
| 1640 } | 1640 } |
| 1641 } | 1641 } |
| 1642 | 1642 |
| 1643 return true; | 1643 return true; |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 } // namespace cc | 1646 } // namespace cc |
| OLD | NEW |