| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/playback/compositing_display_item.h" | 5 #include "cc/playback/compositing_display_item.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/trace_event/trace_event_argument.h" | 8 #include "base/trace_event/trace_event_argument.h" |
| 9 #include "cc/proto/display_item.pb.h" | 9 #include "cc/proto/display_item.pb.h" |
| 10 #include "cc/proto/gfx_conversions.h" | 10 #include "cc/proto/gfx_conversions.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 details.color_filter().c_str(), details.color_filter().size(), | 77 details.color_filter().c_str(), details.color_filter().size(), |
| 78 SkColorFilter::GetFlattenableType()); | 78 SkColorFilter::GetFlattenableType()); |
| 79 filter = skia::AdoptRef(static_cast<SkColorFilter*>(flattenable)); | 79 filter = skia::AdoptRef(static_cast<SkColorFilter*>(flattenable)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 SetNew(alpha, xfermode, bounds.get(), std::move(filter)); | 82 SetNew(alpha, xfermode, bounds.get(), std::move(filter)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void CompositingDisplayItem::Raster( | 85 void CompositingDisplayItem::Raster( |
| 86 SkCanvas* canvas, | 86 SkCanvas* canvas, |
| 87 const gfx::Rect& canvas_target_playback_rect, | |
| 88 SkPicture::AbortCallback* callback) const { | 87 SkPicture::AbortCallback* callback) const { |
| 89 SkPaint paint; | 88 SkPaint paint; |
| 90 paint.setXfermodeMode(xfermode_); | 89 paint.setXfermodeMode(xfermode_); |
| 91 paint.setAlpha(alpha_); | 90 paint.setAlpha(alpha_); |
| 92 paint.setColorFilter(color_filter_.get()); | 91 paint.setColorFilter(color_filter_.get()); |
| 93 canvas->saveLayer(has_bounds_ ? &bounds_ : nullptr, &paint); | 92 canvas->saveLayer(has_bounds_ ? &bounds_ : nullptr, &paint); |
| 94 } | 93 } |
| 95 | 94 |
| 96 void CompositingDisplayItem::AsValueInto( | 95 void CompositingDisplayItem::AsValueInto( |
| 97 const gfx::Rect& visual_rect, | 96 const gfx::Rect& visual_rect, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 117 void EndCompositingDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { | 116 void EndCompositingDisplayItem::ToProtobuf(proto::DisplayItem* proto) const { |
| 118 proto->set_type(proto::DisplayItem::Type_EndCompositing); | 117 proto->set_type(proto::DisplayItem::Type_EndCompositing); |
| 119 } | 118 } |
| 120 | 119 |
| 121 void EndCompositingDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { | 120 void EndCompositingDisplayItem::FromProtobuf(const proto::DisplayItem& proto) { |
| 122 DCHECK_EQ(proto::DisplayItem::Type_EndCompositing, proto.type()); | 121 DCHECK_EQ(proto::DisplayItem::Type_EndCompositing, proto.type()); |
| 123 } | 122 } |
| 124 | 123 |
| 125 void EndCompositingDisplayItem::Raster( | 124 void EndCompositingDisplayItem::Raster( |
| 126 SkCanvas* canvas, | 125 SkCanvas* canvas, |
| 127 const gfx::Rect& canvas_target_playback_rect, | |
| 128 SkPicture::AbortCallback* callback) const { | 126 SkPicture::AbortCallback* callback) const { |
| 129 canvas->restore(); | 127 canvas->restore(); |
| 130 } | 128 } |
| 131 | 129 |
| 132 void EndCompositingDisplayItem::AsValueInto( | 130 void EndCompositingDisplayItem::AsValueInto( |
| 133 const gfx::Rect& visual_rect, | 131 const gfx::Rect& visual_rect, |
| 134 base::trace_event::TracedValue* array) const { | 132 base::trace_event::TracedValue* array) const { |
| 135 array->AppendString( | 133 array->AppendString( |
| 136 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]", | 134 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]", |
| 137 visual_rect.ToString().c_str())); | 135 visual_rect.ToString().c_str())); |
| 138 } | 136 } |
| 139 | 137 |
| 140 } // namespace cc | 138 } // namespace cc |
| OLD | NEW |