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

Side by Side Diff: cc/tiles/software_image_decode_controller.h

Issue 1760053002: cc: ImageDecodes: Cleanup CanHandleImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/software_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_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_ 5 #ifndef CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_
6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_ 6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <unordered_map> 10 #include <unordered_map>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 void SanityCheckState(int line, bool lock_acquired); 193 void SanityCheckState(int line, bool lock_acquired);
194 void RefImage(const ImageKey& key); 194 void RefImage(const ImageKey& key);
195 void RefAtRasterImage(const ImageKey& key); 195 void RefAtRasterImage(const ImageKey& key);
196 void UnrefAtRasterImage(const ImageKey& key); 196 void UnrefAtRasterImage(const ImageKey& key);
197 197
198 // These functions indicate whether the images can be handled and cached by 198 // These functions indicate whether the images can be handled and cached by
199 // ImageDecodeController or whether they will fall through to Skia (with 199 // ImageDecodeController or whether they will fall through to Skia (with
200 // exception of possibly prerolling them). Over time these should return 200 // exception of possibly prerolling them). Over time these should return
201 // "false" in less cases, as the ImageDecodeController should start handling 201 // "false" in less cases, as the ImageDecodeController should start handling
202 // more of them. 202 // more of them.
203 bool CanHandleImage(const ImageKey& key, const DrawImage& image); 203 bool CanHandleImage(const ImageKey& key);
204 bool CanHandleFilterQuality(SkFilterQuality filter_quality);
205 204
206 std::unordered_map<ImageKey, scoped_refptr<ImageDecodeTask>, ImageKeyHash> 205 std::unordered_map<ImageKey, scoped_refptr<ImageDecodeTask>, ImageKeyHash>
207 pending_image_tasks_; 206 pending_image_tasks_;
208 207
209 // The members below this comment can only be accessed if the lock is held to 208 // The members below this comment can only be accessed if the lock is held to
210 // ensure that they are safe to access on multiple threads. 209 // ensure that they are safe to access on multiple threads.
211 base::Lock lock_; 210 base::Lock lock_;
212 211
213 std::deque<AnnotatedDecodedImage> decoded_images_; 212 std::deque<AnnotatedDecodedImage> decoded_images_;
214 std::unordered_map<ImageKey, int, ImageKeyHash> decoded_images_ref_counts_; 213 std::unordered_map<ImageKey, int, ImageKeyHash> decoded_images_ref_counts_;
215 std::deque<AnnotatedDecodedImage> at_raster_decoded_images_; 214 std::deque<AnnotatedDecodedImage> at_raster_decoded_images_;
216 std::unordered_map<ImageKey, int, ImageKeyHash> 215 std::unordered_map<ImageKey, int, ImageKeyHash>
217 at_raster_decoded_images_ref_counts_; 216 at_raster_decoded_images_ref_counts_;
218 MemoryBudget locked_images_budget_; 217 MemoryBudget locked_images_budget_;
219 218
220 // Note that this is used for cases where the only thing we do is preroll the 219 // Note that this is used for cases where the only thing we do is preroll the
221 // image the first time we see it. This mimics the previous behavior and 220 // image the first time we see it. This mimics the previous behavior and
222 // should over time change as the compositor starts to handle more cases. 221 // should over time change as the compositor starts to handle more cases.
223 std::unordered_set<uint32_t> prerolled_images_; 222 std::unordered_set<uint32_t> prerolled_images_;
224 }; 223 };
225 224
226 } // namespace cc 225 } // namespace cc
227 226
228 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_ 227 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/software_image_decode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698