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/gpu_image_decode_controller.h

Issue 1933723002: cc: Unittest for checking already failed image decode task. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@land_task_manager
Patch Set: Created 4 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 | « no previous file | cc/tiles/gpu_image_decode_controller.cc » ('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 #ifndef CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ 5 #ifndef CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_
6 #define CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ 6 #define CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <vector> 10 #include <vector>
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void UploadTaskCompleted(const DrawImage& image); 83 void UploadTaskCompleted(const DrawImage& image);
84 84
85 // For testing only. 85 // For testing only.
86 void SetCachedItemLimitForTesting(size_t limit) { 86 void SetCachedItemLimitForTesting(size_t limit) {
87 cached_items_limit_ = limit; 87 cached_items_limit_ = limit;
88 } 88 }
89 void SetCachedBytesLimitForTesting(size_t limit) { 89 void SetCachedBytesLimitForTesting(size_t limit) {
90 cached_bytes_limit_ = limit; 90 cached_bytes_limit_ = limit;
91 } 91 }
92 size_t GetBytesUsedForTesting() const { return bytes_used_; } 92 size_t GetBytesUsedForTesting() const { return bytes_used_; }
93 void SetImageDecodingFailedForTesting(const DrawImage& image);
93 94
94 private: 95 private:
95 enum class DecodedDataMode { GPU, CPU }; 96 enum class DecodedDataMode { GPU, CPU };
96 97
97 // Stores the CPU-side decoded bits of an image and supporting fields. 98 // Stores the CPU-side decoded bits of an image and supporting fields.
98 struct DecodedImageData { 99 struct DecodedImageData {
99 DecodedImageData(); 100 DecodedImageData();
100 ~DecodedImageData(); 101 ~DecodedImageData();
101 102
102 // May be null if image not yet decoded. 103 // May be null if image not yet decoded.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 190
190 // We can't release GPU backed SkImages without holding the context lock, 191 // We can't release GPU backed SkImages without holding the context lock,
191 // so we add them to this list and defer deletion until the next time the lock 192 // so we add them to this list and defer deletion until the next time the lock
192 // is held. 193 // is held.
193 std::vector<sk_sp<SkImage>> images_pending_deletion_; 194 std::vector<sk_sp<SkImage>> images_pending_deletion_;
194 }; 195 };
195 196
196 } // namespace cc 197 } // namespace cc
197 198
198 #endif // CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_ 199 #endif // CC_TILES_GPU_IMAGE_DECODE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/gpu_image_decode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698