Chromium Code Reviews| 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 |