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

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

Issue 2703633004: cc: Make image controller return a status with the callback. (Closed)
Patch Set: update Created 3 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 | « cc/tiles/checker_image_tracker.h ('k') | cc/tiles/checker_image_tracker_unittest.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 #include "cc/tiles/checker_image_tracker.h" 5 #include "cc/tiles/checker_image_tracker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 auto it = image_id_to_decode_request_id_.find(image_id); 70 auto it = image_id_to_decode_request_id_.find(image_id);
71 image_controller_->UnlockImageDecode(it->second); 71 image_controller_->UnlockImageDecode(it->second);
72 image_id_to_decode_request_id_.erase(it); 72 image_id_to_decode_request_id_.erase(it);
73 } 73 }
74 74
75 invalidated_images_on_current_sync_tree_.clear(); 75 invalidated_images_on_current_sync_tree_.clear();
76 } 76 }
77 77
78 void CheckerImageTracker::DidFinishImageDecode( 78 void CheckerImageTracker::DidFinishImageDecode(
79 ImageId image_id, 79 ImageId image_id,
80 ImageController::ImageDecodeRequestId request_id) { 80 ImageController::ImageDecodeRequestId request_id,
81 ImageController::ImageDecodeResult result) {
81 TRACE_EVENT_ASYNC_END0("cc", "CheckerImageTracker::DeferImageDecode", 82 TRACE_EVENT_ASYNC_END0("cc", "CheckerImageTracker::DeferImageDecode",
82 image_id); 83 image_id);
83 84
85 DCHECK_NE(result, ImageController::ImageDecodeResult::DECODE_NOT_REQUIRED);
84 DCHECK_NE(pending_image_decodes_.count(image_id), 0u); 86 DCHECK_NE(pending_image_decodes_.count(image_id), 0u);
85 pending_image_decodes_.erase(image_id); 87 pending_image_decodes_.erase(image_id);
86 88
87 images_decoded_once_.insert(image_id); 89 images_decoded_once_.insert(image_id);
88 images_pending_invalidation_.insert(image_id); 90 images_pending_invalidation_.insert(image_id);
89 client_->NeedsInvalidationForCheckerImagedTiles(); 91 client_->NeedsInvalidationForCheckerImagedTiles();
90 } 92 }
91 93
92 bool CheckerImageTracker::ShouldCheckerImage(const sk_sp<const SkImage>& image, 94 bool CheckerImageTracker::ShouldCheckerImage(const sk_sp<const SkImage>& image,
93 WhichTree tree) const { 95 WhichTree tree) const {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 DCHECK_EQ(image_id_to_decode_request_id_.count(image_id), 0U); 145 DCHECK_EQ(image_id_to_decode_request_id_.count(image_id), 0U);
144 146
145 image_id_to_decode_request_id_[image_id] = 147 image_id_to_decode_request_id_[image_id] =
146 image_controller_->QueueImageDecode( 148 image_controller_->QueueImageDecode(
147 image, base::Bind(&CheckerImageTracker::DidFinishImageDecode, 149 image, base::Bind(&CheckerImageTracker::DidFinishImageDecode,
148 weak_factory_.GetWeakPtr(), image_id)); 150 weak_factory_.GetWeakPtr(), image_id));
149 pending_image_decodes_.insert(image_id); 151 pending_image_decodes_.insert(image_id);
150 } 152 }
151 153
152 } // namespace cc 154 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/checker_image_tracker.h ('k') | cc/tiles/checker_image_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698