OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ | 5 #ifndef CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ |
6 #define CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ | 6 #define CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/containers/mru_cache.h" | 12 #include "base/containers/mru_cache.h" |
13 #include "base/memory/discardable_memory.h" | 13 #include "base/memory/discardable_memory.h" |
14 #include "base/memory/memory_coordinator_client.h" | 14 #include "base/memory/memory_coordinator_client.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/trace_event/memory_dump_provider.h" | 16 #include "base/trace_event/memory_dump_provider.h" |
17 #include "cc/base/cc_export.h" | 17 #include "cc/base/cc_export.h" |
18 #include "cc/resources/resource_format.h" | 18 #include "cc/resources/resource_format.h" |
19 #include "cc/tiles/image_decode_controller.h" | 19 #include "cc/tiles/image_decode_controller.h" |
20 #include "third_party/skia/include/core/SkRefCnt.h" | 20 #include "third_party/skia/include/core/SkRefCnt.h" |
21 | 21 |
22 class SkImageTextureData; | |
23 | |
24 namespace cc { | 22 namespace cc { |
25 | 23 |
26 class ContextProvider; | 24 class ContextProvider; |
27 | 25 |
28 // OVERVIEW: | 26 // OVERVIEW: |
29 // | 27 // |
30 // GpuImageDecodeController handles the decode and upload of images that will | 28 // GpuImageDecodeController handles the decode and upload of images that will |
31 // be used by Skia's GPU raster path. It also maintains a cache of these | 29 // be used by Skia's GPU raster path. It also maintains a cache of these |
32 // decoded/uploaded images for later re-use. | 30 // decoded/uploaded images for later re-use. |
33 // | 31 // |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 325 |
328 // We can't release GPU backed SkImages without holding the context lock, | 326 // We can't release GPU backed SkImages without holding the context lock, |
329 // so we add them to this list and defer deletion until the next time the lock | 327 // so we add them to this list and defer deletion until the next time the lock |
330 // is held. | 328 // is held. |
331 std::vector<sk_sp<SkImage>> images_pending_deletion_; | 329 std::vector<sk_sp<SkImage>> images_pending_deletion_; |
332 }; | 330 }; |
333 | 331 |
334 } // namespace cc | 332 } // namespace cc |
335 | 333 |
336 #endif // CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ | 334 #endif // CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ |
OLD | NEW |