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

Unified Diff: ui/compositor/compositing_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/compositing_recorder.cc
diff --git a/ui/compositor/compositing_recorder.cc b/ui/compositor/compositing_recorder.cc
index f485990ef33caaa6d503fc26d0596aa696db05cf..d566693e6acf3ecbe785b5c9647c97e44c677a5f 100644
--- a/ui/compositor/compositing_recorder.cc
+++ b/ui/compositor/compositing_recorder.cc
@@ -8,17 +8,21 @@
#include "cc/playback/display_item_list.h"
#include "ui/compositor/paint_context.h"
#include "ui/gfx/canvas.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.
namespace ui {
CompositingRecorder::CompositingRecorder(const PaintContext& context,
+ const gfx::Size& layer_size,
uint8_t alpha)
- : context_(context), saved_(alpha < 255) {
+ : context_(context),
+ layer_bounds_(context.ToLayerSpaceBounds(layer_size)),
+ saved_(alpha < 255) {
if (!saved_)
return;
- auto* item =
- context_.list_->CreateAndAppendItem<cc::CompositingDisplayItem>();
+ auto* item = context_.list_->CreateAndAppendItem<cc::CompositingDisplayItem>(
+ layer_bounds_);
item->SetNew(alpha, SkXfermode::kSrcOver_Mode, nullptr /* no bounds */,
skia::RefPtr<SkColorFilter>());
}
@@ -27,7 +31,8 @@ CompositingRecorder::~CompositingRecorder() {
if (!saved_)
return;
- context_.list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>();
+ context_.list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>(
+ layer_bounds_);
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698