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

Unified Diff: cc/playback/display_item_list.cc

Issue 1397203003: cc: Make discardable image metadata generation work with no caching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/playback/display_item_list.cc
diff --git a/cc/playback/display_item_list.cc b/cc/playback/display_item_list.cc
index a9fbfaa37e0b33ddd99f93abacf318b7e22bf037..43f103c30dfa1ef946e978887acb2c6cede5e286 100644
--- a/cc/playback/display_item_list.cc
+++ b/cc/playback/display_item_list.cc
@@ -272,9 +272,9 @@ void DisplayItemList::EmitTraceSnapshot() const {
void DisplayItemList::GenerateDiscardableImagesMetadata() {
DCHECK(ProcessAppendedItemsCalled());
// This should be only called once, and only after CreateAndCacheSkPicture.
- DCHECK(picture_);
DCHECK(image_map_.empty());
- if (!picture_->willPlayBackBitmaps())
+ DCHECK_IMPLIES(use_cached_picture_, picture_);
+ if (use_cached_picture_ && !picture_->willPlayBackBitmaps())
return;
// The cached picture is translated by -layer_rect_.origin during record,
@@ -282,8 +282,8 @@ void DisplayItemList::GenerateDiscardableImagesMetadata() {
// images.
DiscardableImageMap::ScopedMetadataGenerator generator(
&image_map_, gfx::Size(layer_rect_.right(), layer_rect_.bottom()));
- generator.canvas()->translate(layer_rect_.x(), layer_rect_.y());
- generator.canvas()->drawPicture(picture_.get());
+ Raster(generator.canvas(), nullptr,
+ gfx::Rect(layer_rect_.right(), layer_rect_.bottom()), 1.f);
}
void DisplayItemList::GetDiscardableImagesInRect(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698