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 "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/macros.h" |
9 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
11 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
12 #include "cc/output/managed_memory_policy.h" | 15 #include "cc/output/managed_memory_policy.h" |
13 #include "cc/output/output_surface_client.h" | 16 #include "cc/output/output_surface_client.h" |
14 #include "gpu/GLES2/gl2extchromium.h" | 17 #include "gpu/GLES2/gl2extchromium.h" |
15 #include "gpu/command_buffer/client/context_support.h" | 18 #include "gpu/command_buffer/client/context_support.h" |
16 #include "gpu/command_buffer/client/gles2_interface.h" | 19 #include "gpu/command_buffer/client/gles2_interface.h" |
17 #include "third_party/skia/include/core/SkTraceMemoryDump.h" | 20 #include "third_party/skia/include/core/SkTraceMemoryDump.h" |
18 #include "third_party/skia/include/gpu/GrContext.h" | 21 #include "third_party/skia/include/gpu/GrContext.h" |
(...skipping 27 matching lines...) Expand all Loading... |
46 const char* value_name, | 49 const char* value_name, |
47 const char* units, | 50 const char* units, |
48 uint64_t value) override { | 51 uint64_t value) override { |
49 auto dump = GetOrCreateAllocatorDump(dump_name); | 52 auto dump = GetOrCreateAllocatorDump(dump_name); |
50 dump->AddScalar(value_name, units, value); | 53 dump->AddScalar(value_name, units, value); |
51 } | 54 } |
52 | 55 |
53 void setMemoryBacking(const char* dump_name, | 56 void setMemoryBacking(const char* dump_name, |
54 const char* backing_type, | 57 const char* backing_type, |
55 const char* backing_object_id) override { | 58 const char* backing_object_id) override { |
56 const uint64 tracing_process_id = | 59 const uint64_t tracing_process_id = |
57 base::trace_event::MemoryDumpManager::GetInstance() | 60 base::trace_event::MemoryDumpManager::GetInstance() |
58 ->GetTracingProcessId(); | 61 ->GetTracingProcessId(); |
59 | 62 |
60 // For uniformity, skia provides this value as a string. Convert back to a | 63 // For uniformity, skia provides this value as a string. Convert back to a |
61 // uint32_t. | 64 // uint32_t. |
62 uint32_t gl_id = | 65 uint32_t gl_id = |
63 std::strtoul(backing_object_id, nullptr /* str_end */, 10 /* base */); | 66 std::strtoul(backing_object_id, nullptr /* str_end */, 10 /* base */); |
64 | 67 |
65 // Populated in if statements below. | 68 // Populated in if statements below. |
66 base::trace_event::MemoryAllocatorDumpGuid guid; | 69 base::trace_event::MemoryAllocatorDumpGuid guid; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if (context_provider_.get()) { | 354 if (context_provider_.get()) { |
352 context_provider_->SetLostContextCallback( | 355 context_provider_->SetLostContextCallback( |
353 ContextProvider::LostContextCallback()); | 356 ContextProvider::LostContextCallback()); |
354 } | 357 } |
355 context_provider_ = nullptr; | 358 context_provider_ = nullptr; |
356 client_ = nullptr; | 359 client_ = nullptr; |
357 weak_ptr_factory_.InvalidateWeakPtrs(); | 360 weak_ptr_factory_.InvalidateWeakPtrs(); |
358 } | 361 } |
359 | 362 |
360 } // namespace cc | 363 } // namespace cc |
OLD | NEW |