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

Unified Diff: ui/compositor/paint_cache.cc

Issue 2751833007: cc: Move DisplayItem::Raster up to DisplayItemList (Closed)
Patch Set: virtualraster: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/paint_cache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/paint_cache.cc
diff --git a/ui/compositor/paint_cache.cc b/ui/compositor/paint_cache.cc
index 9feaca05e832d1e3b253bbb9f7deb004b31655e9..c7c431a7055ed88b0dea687dd237dedec1925927 100644
--- a/ui/compositor/paint_cache.cc
+++ b/ui/compositor/paint_cache.cc
@@ -9,26 +9,24 @@
namespace ui {
-PaintCache::PaintCache() : has_cache_(false) {
-}
+PaintCache::PaintCache() {}
PaintCache::~PaintCache() {
}
bool PaintCache::UseCache(const PaintContext& context,
const gfx::Size& size_in_context) {
- if (!has_cache_)
+ if (!display_item_.has_value())
return false;
DCHECK(context.list_);
gfx::Rect bounds_in_layer = context.ToLayerSpaceBounds(size_in_context);
context.list_->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>(
- bounds_in_layer, display_item_);
+ bounds_in_layer, *display_item_);
return true;
}
void PaintCache::SetCache(const cc::DrawingDisplayItem& item) {
- item.CloneTo(&display_item_);
- has_cache_ = true;
+ display_item_.emplace(item);
}
} // namespace ui
« no previous file with comments | « ui/compositor/paint_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698