| 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_CONTROLLER_H_ | 5 #ifndef CC_TILES_IMAGE_CONTROLLER_H_ |
| 6 #define CC_TILES_IMAGE_CONTROLLER_H_ | 6 #define CC_TILES_IMAGE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/threading/simple_thread.h" | 14 #include "base/threading/simple_thread.h" |
| 15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
| 16 #include "cc/base/unique_notifier.h" | 16 #include "cc/base/unique_notifier.h" |
| 17 #include "cc/playback/draw_image.h" | 17 #include "cc/playback/draw_image.h" |
| 18 #include "cc/raster/tile_task.h" | 18 #include "cc/raster/tile_task.h" |
| 19 #include "cc/tiles/image_decode_cache.h" | 19 #include "cc/tiles/image_decode_cache.h" |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 | 22 |
| 23 class CC_EXPORT ImageController { | 23 class CC_EXPORT ImageController { |
| 24 public: | 24 public: |
| 25 enum class ImageDecodeResult { SUCCESS, DECODE_NOT_REQUIRED, FAILURE }; |
| 26 |
| 25 using ImageDecodeRequestId = uint64_t; | 27 using ImageDecodeRequestId = uint64_t; |
| 26 using ImageDecodedCallback = base::Callback<void(ImageDecodeRequestId)>; | 28 using ImageDecodedCallback = |
| 29 base::Callback<void(ImageDecodeRequestId, ImageDecodeResult)>; |
| 27 explicit ImageController( | 30 explicit ImageController( |
| 28 base::SequencedTaskRunner* origin_task_runner, | 31 base::SequencedTaskRunner* origin_task_runner, |
| 29 scoped_refptr<base::SequencedTaskRunner> worker_task_runner); | 32 scoped_refptr<base::SequencedTaskRunner> worker_task_runner); |
| 30 virtual ~ImageController(); | 33 virtual ~ImageController(); |
| 31 | 34 |
| 32 void SetImageDecodeCache(ImageDecodeCache* cache); | 35 void SetImageDecodeCache(ImageDecodeCache* cache); |
| 33 void GetTasksForImagesAndRef( | 36 void GetTasksForImagesAndRef( |
| 34 std::vector<DrawImage>* images, | 37 std::vector<DrawImage>* images, |
| 35 std::vector<scoped_refptr<TileTask>>* tasks, | 38 std::vector<scoped_refptr<TileTask>>* tasks, |
| 36 const ImageDecodeCache::TracingInfo& tracing_info); | 39 const ImageDecodeCache::TracingInfo& tracing_info); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 bool abort_tasks_ = false; | 104 bool abort_tasks_ = false; |
| 102 | 105 |
| 103 base::WeakPtrFactory<ImageController> weak_ptr_factory_; | 106 base::WeakPtrFactory<ImageController> weak_ptr_factory_; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(ImageController); | 108 DISALLOW_COPY_AND_ASSIGN(ImageController); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 } // namespace cc | 111 } // namespace cc |
| 109 | 112 |
| 110 #endif // CC_TILES_IMAGE_CONTROLLER_H_ | 113 #endif // CC_TILES_IMAGE_CONTROLLER_H_ |
| OLD | NEW |