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

Unified Diff: ui/compositor/paint_recorder.cc

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: De-static const rect in test. Created 5 years, 1 month 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
Index: ui/compositor/paint_recorder.cc
diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc
index 45b6f35efdc0a81413e8edd52bc48572dd61ac70..b360c079436e7a5251adec190a006424af0bfa3e 100644
--- a/ui/compositor/paint_recorder.cc
+++ b/ui/compositor/paint_recorder.cc
@@ -9,6 +9,7 @@
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "ui/compositor/paint_cache.h"
#include "ui/compositor/paint_context.h"
+#include "ui/gfx/geometry/rect.h"
danakj 2015/11/17 22:14:33 already in the .h file
wkorman 2015/11/17 23:43:05 Done.
#include "ui/gfx/skia_util.h"
namespace ui {
@@ -24,7 +25,8 @@ PaintRecorder::PaintRecorder(const PaintContext& context,
gfx::RectToSkRect(gfx::Rect(recording_size))))
.get(),
context.device_scale_factor_),
- cache_(cache) {
+ cache_(cache),
+ layer_bounds_(context.ToLayerSpaceBounds(recording_size)) {
#if DCHECK_IS_ON()
DCHECK(!context.inside_paint_recorder_);
context.inside_paint_recorder_ = true;
@@ -41,10 +43,11 @@ PaintRecorder::~PaintRecorder() {
context_.inside_paint_recorder_ = false;
#endif
- auto* item = context_.list_->CreateAndAppendItem<cc::DrawingDisplayItem>();
+ auto* item = context_.list_->CreateAndAppendItem<cc::DrawingDisplayItem>(
+ layer_bounds_);
item->SetNew(skia::AdoptRef(context_.recorder_->endRecordingAsPicture()));
if (cache_)
- cache_->SetCache(item);
+ cache_->SetCache(layer_bounds_, item);
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698