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

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

Issue 2844273004: cc: Make images that can't possibly fit in cache not checker. (Closed)
Patch Set: tests Created 3 years, 7 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/image_controller.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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void ClearCache() override {}
132 size_t GetMaximumMemoryLimitBytes() const override {
133 return 256 * 1024 * 1024;
134 }
132 135
133 int number_of_refs() const { return number_of_refs_; } 136 int number_of_refs() const { return number_of_refs_; }
134 void SetTaskToUse(scoped_refptr<TileTask> task) { task_to_use_ = task; } 137 void SetTaskToUse(scoped_refptr<TileTask> task) { task_to_use_ = task; }
135 138
136 private: 139 private:
137 int number_of_refs_ = 0; 140 int number_of_refs_ = 0;
138 scoped_refptr<TileTask> task_to_use_; 141 scoped_refptr<TileTask> task_to_use_;
139 }; 142 };
140 143
141 // A simple class that can receive decode callbacks. 144 // A simple class that can receive decode callbacks.
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 decode_client2.result()); 591 decode_client2.result());
589 592
590 // Reset the controller since the order of destruction is wrong in this test 593 // Reset the controller since the order of destruction is wrong in this test
591 // (|other_cache| should outlive the controller. This is normally done via 594 // (|other_cache| should outlive the controller. This is normally done via
592 // SetImageDecodeCache(nullptr) or it can be done in the dtor of the cache.) 595 // SetImageDecodeCache(nullptr) or it can be done in the dtor of the cache.)
593 ResetController(); 596 ResetController();
594 } 597 }
595 598
596 } // namespace 599 } // namespace
597 } // namespace cc 600 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/image_controller.cc ('k') | cc/tiles/image_decode_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698