| 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_IMAGE_MANAGER_H_ | 5 #ifndef CC_TILES_IMAGE_MANAGER_H_ |
| 6 #define CC_TILES_IMAGE_MANAGER_H_ | 6 #define CC_TILES_IMAGE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 13 #include "cc/playback/draw_image.h" | 13 #include "cc/playback/draw_image.h" |
| 14 #include "cc/raster/tile_task.h" | 14 #include "cc/raster/tile_task.h" |
| 15 #include "cc/tiles/image_decode_controller.h" | 15 #include "cc/tiles/image_decode_cache.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 class CC_EXPORT ImageManager { | 19 class CC_EXPORT ImageManager { |
| 20 public: | 20 public: |
| 21 ImageManager(); | 21 ImageManager(); |
| 22 ~ImageManager(); | 22 ~ImageManager(); |
| 23 | 23 |
| 24 void SetImageDecodeController(ImageDecodeController* controller); | 24 void SetImageDecodeCache(ImageDecodeCache* controller); |
| 25 void GetTasksForImagesAndRef( | 25 void GetTasksForImagesAndRef( |
| 26 std::vector<DrawImage>* images, | 26 std::vector<DrawImage>* images, |
| 27 std::vector<scoped_refptr<TileTask>>* tasks, | 27 std::vector<scoped_refptr<TileTask>>* tasks, |
| 28 const ImageDecodeController::TracingInfo& tracing_info); | 28 const ImageDecodeCache::TracingInfo& tracing_info); |
| 29 void UnrefImages(const std::vector<DrawImage>& images); | 29 void UnrefImages(const std::vector<DrawImage>& images); |
| 30 void ReduceMemoryUsage(); | 30 void ReduceMemoryUsage(); |
| 31 std::vector<scoped_refptr<TileTask>> SetPredecodeImages( | 31 std::vector<scoped_refptr<TileTask>> SetPredecodeImages( |
| 32 std::vector<DrawImage> predecode_images, | 32 std::vector<DrawImage> predecode_images, |
| 33 const ImageDecodeController::TracingInfo& tracing_info); | 33 const ImageDecodeCache::TracingInfo& tracing_info); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 ImageDecodeController* controller_ = nullptr; | 36 ImageDecodeCache* cache_ = nullptr; |
| 37 std::vector<DrawImage> predecode_locked_images_; | 37 std::vector<DrawImage> predecode_locked_images_; |
| 38 | 38 |
| 39 // Debugging information for crbug.com/650234. | 39 // Debugging information for crbug.com/650234. |
| 40 size_t num_times_controller_was_set_ = 0; | 40 size_t num_times_cache_was_set_ = 0; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(ImageManager); | 42 DISALLOW_COPY_AND_ASSIGN(ImageManager); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace cc | 45 } // namespace cc |
| 46 | 46 |
| 47 #endif // CC_TILES_IMAGE_MANAGER_H_ | 47 #endif // CC_TILES_IMAGE_MANAGER_H_ |
| OLD | NEW |