| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/tiles/software_image_decode_controller.h" | 5 #include "cc/tiles/software_image_decode_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <functional> | 9 #include <functional> |
| 10 | 10 |
| 11 #include "base/format_macros.h" | 11 #include "base/format_macros.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/discardable_memory.h" | 13 #include "base/memory/discardable_memory.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 17 #include "base/trace_event/memory_dump_manager.h" | 17 #include "base/trace_event/memory_dump_manager.h" |
| 18 #include "cc/debug/devtools_instrumentation.h" | 18 #include "cc/debug/devtools_instrumentation.h" |
| 19 #include "cc/raster/tile_task_runner.h" | 19 #include "cc/raster/tile_task.h" |
| 20 #include "third_party/skia/include/core/SkCanvas.h" | 20 #include "third_party/skia/include/core/SkCanvas.h" |
| 21 #include "third_party/skia/include/core/SkImage.h" | 21 #include "third_party/skia/include/core/SkImage.h" |
| 22 #include "ui/gfx/skia_util.h" | 22 #include "ui/gfx/skia_util.h" |
| 23 | 23 |
| 24 namespace cc { | 24 namespace cc { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // The amount of memory we can lock ahead of time (128MB). This limit is only | 27 // The amount of memory we can lock ahead of time (128MB). This limit is only |
| 28 // used to inform the caller of the amount of space available in the cache. The | 28 // used to inform the caller of the amount of space available in the cache. The |
| 29 // caller can still request tasks which can cause this limit to be breached. | 29 // caller can still request tasks which can cause this limit to be breached. |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 void SoftwareImageDecodeController::MemoryBudget::ResetUsage() { | 933 void SoftwareImageDecodeController::MemoryBudget::ResetUsage() { |
| 934 current_usage_bytes_ = 0; | 934 current_usage_bytes_ = 0; |
| 935 } | 935 } |
| 936 | 936 |
| 937 size_t SoftwareImageDecodeController::MemoryBudget::GetCurrentUsageSafe() | 937 size_t SoftwareImageDecodeController::MemoryBudget::GetCurrentUsageSafe() |
| 938 const { | 938 const { |
| 939 return current_usage_bytes_.ValueOrDie(); | 939 return current_usage_bytes_.ValueOrDie(); |
| 940 } | 940 } |
| 941 | 941 |
| 942 } // namespace cc | 942 } // namespace cc |
| OLD | NEW |