| 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
|
|
|