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 #include "cc/tiles/image_controller.h" | 5 #include "cc/tiles/image_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/optional.h" | 10 #include "base/optional.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 --number_of_refs_; | 121 --number_of_refs_; |
122 } | 122 } |
123 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override { | 123 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override { |
124 return DecodedDrawImage(nullptr, kNone_SkFilterQuality); | 124 return DecodedDrawImage(nullptr, kNone_SkFilterQuality); |
125 } | 125 } |
126 void DrawWithImageFinished(const DrawImage& image, | 126 void DrawWithImageFinished(const DrawImage& image, |
127 const DecodedDrawImage& decoded_image) override {} | 127 const DecodedDrawImage& decoded_image) override {} |
128 void ReduceCacheUsage() override {} | 128 void ReduceCacheUsage() override {} |
129 void SetShouldAggressivelyFreeResources( | 129 void SetShouldAggressivelyFreeResources( |
130 bool aggressively_free_resources) override {} | 130 bool aggressively_free_resources) override {} |
| 131 void ClearCache() override {} |
131 | 132 |
132 int number_of_refs() const { return number_of_refs_; } | 133 int number_of_refs() const { return number_of_refs_; } |
133 void SetTaskToUse(scoped_refptr<TileTask> task) { task_to_use_ = task; } | 134 void SetTaskToUse(scoped_refptr<TileTask> task) { task_to_use_ = task; } |
134 | 135 |
135 private: | 136 private: |
136 int number_of_refs_ = 0; | 137 int number_of_refs_ = 0; |
137 scoped_refptr<TileTask> task_to_use_; | 138 scoped_refptr<TileTask> task_to_use_; |
138 }; | 139 }; |
139 | 140 |
140 // A simple class that can receive decode callbacks. | 141 // A simple class that can receive decode callbacks. |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 decode_client2.result()); | 587 decode_client2.result()); |
587 | 588 |
588 // Reset the controller since the order of destruction is wrong in this test | 589 // Reset the controller since the order of destruction is wrong in this test |
589 // (|other_cache| should outlive the controller. This is normally done via | 590 // (|other_cache| should outlive the controller. This is normally done via |
590 // SetImageDecodeCache(nullptr) or it can be done in the dtor of the cache.) | 591 // SetImageDecodeCache(nullptr) or it can be done in the dtor of the cache.) |
591 ResetController(); | 592 ResetController(); |
592 } | 593 } |
593 | 594 |
594 } // namespace | 595 } // namespace |
595 } // namespace cc | 596 } // namespace cc |
OLD | NEW |