Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: cc/tiles/image_controller_unittest.cc

Issue 2795803002: Clear Image Decode Cache on Navigation (Closed)
Patch Set: fix conversion Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/tiles/gpu_image_decode_cache_unittest.cc ('k') | cc/tiles/image_decode_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/tiles/gpu_image_decode_cache_unittest.cc ('k') | cc/tiles/image_decode_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698