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

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

Issue 2948033005: cc: Drop locked decodes from checker image tracker on cache switch. (Closed)
Patch Set: tested Created 3 years, 6 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/tile_manager.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_CHECKER_IMAGE_TRACKER_H_ 5 #ifndef CC_TILES_CHECKER_IMAGE_TRACKER_H_
6 #define CC_TILES_CHECKER_IMAGE_TRACKER_H_ 6 #define CC_TILES_CHECKER_IMAGE_TRACKER_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 void ClearTracker(bool can_clear_decode_policy_tracking); 59 void ClearTracker(bool can_clear_decode_policy_tracking);
60 60
61 // Informs the tracker to not checker the given image. This can be used to opt 61 // Informs the tracker to not checker the given image. This can be used to opt
62 // out of the checkering behavior for certain images, such as ones that were 62 // out of the checkering behavior for certain images, such as ones that were
63 // decoded using the img.decode api. 63 // decoded using the img.decode api.
64 // Note that if the image is already being checkered, then it will continue to 64 // Note that if the image is already being checkered, then it will continue to
65 // do so. This call is meant to be issued prior to the image appearing during 65 // do so. This call is meant to be issued prior to the image appearing during
66 // raster. 66 // raster.
67 void DisallowCheckeringForImage(const PaintImage& image); 67 void DisallowCheckeringForImage(const PaintImage& image);
68 68
69 bool has_locked_decodes_for_testing() const {
70 return !image_id_to_decode_.empty();
71 }
72
69 private: 73 private:
70 enum class DecodePolicy { 74 enum class DecodePolicy {
71 // The image can be decoded asynchronously from raster. When set, the image 75 // The image can be decoded asynchronously from raster. When set, the image
72 // is always skipped during rasterization of content that includes this 76 // is always skipped during rasterization of content that includes this
73 // image until it has been decoded using the decode service. 77 // image until it has been decoded using the decode service.
74 ASYNC, 78 ASYNC,
75 // The image has been decoded asynchronously once and should now be 79 // The image has been decoded asynchronously once and should now be
76 // synchronously rasterized with the content or the image has been 80 // synchronously rasterized with the content or the image has been
77 // permanently vetoed from being decoded async. 81 // permanently vetoed from being decoded async.
78 SYNC 82 SYNC
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 image_id_to_decode_; 146 image_id_to_decode_;
143 147
144 base::WeakPtrFactory<CheckerImageTracker> weak_factory_; 148 base::WeakPtrFactory<CheckerImageTracker> weak_factory_;
145 149
146 DISALLOW_COPY_AND_ASSIGN(CheckerImageTracker); 150 DISALLOW_COPY_AND_ASSIGN(CheckerImageTracker);
147 }; 151 };
148 152
149 } // namespace cc 153 } // namespace cc
150 154
151 #endif // CC_TILES_CHECKER_IMAGE_TRACKER_H_ 155 #endif // CC_TILES_CHECKER_IMAGE_TRACKER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698