| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 lcd_text_requires_opaque_layer); | 33 lcd_text_requires_opaque_layer); |
| 34 } | 34 } |
| 35 | 35 |
| 36 CompositingDisplayItem::CompositingDisplayItem( | 36 CompositingDisplayItem::CompositingDisplayItem( |
| 37 const proto::DisplayItem& proto) { | 37 const proto::DisplayItem& proto) { |
| 38 DCHECK_EQ(proto::DisplayItem::Type_Compositing, proto.type()); | 38 DCHECK_EQ(proto::DisplayItem::Type_Compositing, proto.type()); |
| 39 | 39 |
| 40 const proto::CompositingDisplayItem& details = proto.compositing_item(); | 40 const proto::CompositingDisplayItem& details = proto.compositing_item(); |
| 41 uint8_t alpha = static_cast<uint8_t>(details.alpha()); | 41 uint8_t alpha = static_cast<uint8_t>(details.alpha()); |
| 42 SkXfermode::Mode xfermode = SkXfermodeModeFromProto(details.mode()); | 42 SkXfermode::Mode xfermode = SkXfermodeModeFromProto(details.mode()); |
| 43 scoped_ptr<SkRect> bounds; | 43 std::unique_ptr<SkRect> bounds; |
| 44 if (details.has_bounds()) { | 44 if (details.has_bounds()) { |
| 45 bounds.reset( | 45 bounds.reset( |
| 46 new SkRect(gfx::RectFToSkRect(ProtoToRectF(details.bounds())))); | 46 new SkRect(gfx::RectFToSkRect(ProtoToRectF(details.bounds())))); |
| 47 } | 47 } |
| 48 | 48 |
| 49 sk_sp<SkColorFilter> filter; | 49 sk_sp<SkColorFilter> filter; |
| 50 if (details.has_color_filter()) { | 50 if (details.has_color_filter()) { |
| 51 SkFlattenable* flattenable = SkValidatingDeserializeFlattenable( | 51 SkFlattenable* flattenable = SkValidatingDeserializeFlattenable( |
| 52 details.color_filter().c_str(), details.color_filter().size(), | 52 details.color_filter().c_str(), details.color_filter().size(), |
| 53 SkColorFilter::GetFlattenableType()); | 53 SkColorFilter::GetFlattenableType()); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 array->AppendString( | 163 array->AppendString( |
| 164 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]", | 164 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]", |
| 165 visual_rect.ToString().c_str())); | 165 visual_rect.ToString().c_str())); |
| 166 } | 166 } |
| 167 | 167 |
| 168 size_t EndCompositingDisplayItem::ExternalMemoryUsage() const { | 168 size_t EndCompositingDisplayItem::ExternalMemoryUsage() const { |
| 169 return 0; | 169 return 0; |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace cc | 172 } // namespace cc |
| OLD | NEW |