| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 ImageSerializationProcessor* image_serialization_processor) const { | 83 ImageSerializationProcessor* image_serialization_processor) const { |
| 84 proto->set_type(proto::DisplayItem::Type_Compositing); | 84 proto->set_type(proto::DisplayItem::Type_Compositing); |
| 85 | 85 |
| 86 proto::CompositingDisplayItem* details = proto->mutable_compositing_item(); | 86 proto::CompositingDisplayItem* details = proto->mutable_compositing_item(); |
| 87 details->set_alpha(static_cast<uint32_t>(alpha_)); | 87 details->set_alpha(static_cast<uint32_t>(alpha_)); |
| 88 details->set_mode(SkXfermodeModeToProto(xfermode_)); | 88 details->set_mode(SkXfermodeModeToProto(xfermode_)); |
| 89 if (has_bounds_) | 89 if (has_bounds_) |
| 90 RectFToProto(gfx::SkRectToRectF(bounds_), details->mutable_bounds()); | 90 RectFToProto(gfx::SkRectToRectF(bounds_), details->mutable_bounds()); |
| 91 | 91 |
| 92 if (color_filter_) { | 92 if (color_filter_) { |
| 93 skia::RefPtr<SkData> data = | 93 sk_sp<SkData> data(SkValidatingSerializeFlattenable(color_filter_.get())); |
| 94 skia::AdoptRef(SkValidatingSerializeFlattenable(color_filter_.get())); | |
| 95 if (data->size() > 0) | 94 if (data->size() > 0) |
| 96 details->set_color_filter(data->data(), data->size()); | 95 details->set_color_filter(data->data(), data->size()); |
| 97 } | 96 } |
| 98 | 97 |
| 99 details->set_lcd_text_requires_opaque_layer(lcd_text_requires_opaque_layer_); | 98 details->set_lcd_text_requires_opaque_layer(lcd_text_requires_opaque_layer_); |
| 100 } | 99 } |
| 101 | 100 |
| 102 void CompositingDisplayItem::Raster( | 101 void CompositingDisplayItem::Raster( |
| 103 SkCanvas* canvas, | 102 SkCanvas* canvas, |
| 104 const gfx::Rect& canvas_target_playback_rect, | 103 const gfx::Rect& canvas_target_playback_rect, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 array->AppendString( | 162 array->AppendString( |
| 164 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]", | 163 base::StringPrintf("EndCompositingDisplayItem visualRect: [%s]", |
| 165 visual_rect.ToString().c_str())); | 164 visual_rect.ToString().c_str())); |
| 166 } | 165 } |
| 167 | 166 |
| 168 size_t EndCompositingDisplayItem::ExternalMemoryUsage() const { | 167 size_t EndCompositingDisplayItem::ExternalMemoryUsage() const { |
| 169 return 0; | 168 return 0; |
| 170 } | 169 } |
| 171 | 170 |
| 172 } // namespace cc | 171 } // namespace cc |
| OLD | NEW |