| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/filter_display_item.h" | 5 #include "cc/playback/filter_display_item.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 boundaries.offset(-origin_.x(), -origin_.y()); | 45 boundaries.offset(-origin_.x(), -origin_.y()); |
| 46 | 46 |
| 47 SkPaint paint; | 47 SkPaint paint; |
| 48 paint.setBlendMode(SkBlendMode::kSrcOver); | 48 paint.setBlendMode(SkBlendMode::kSrcOver); |
| 49 paint.setImageFilter(std::move(image_filter)); | 49 paint.setImageFilter(std::move(image_filter)); |
| 50 canvas->saveLayer(&boundaries, &paint); | 50 canvas->saveLayer(&boundaries, &paint); |
| 51 | 51 |
| 52 canvas->translate(-origin_.x(), -origin_.y()); | 52 canvas->translate(-origin_.x(), -origin_.y()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void FilterDisplayItem::AsValueInto( | |
| 56 const gfx::Rect& visual_rect, | |
| 57 base::trace_event::TracedValue* array) const { | |
| 58 array->AppendString(base::StringPrintf( | |
| 59 "FilterDisplayItem bounds: [%s] visualRect: [%s]", | |
| 60 bounds_.ToString().c_str(), visual_rect.ToString().c_str())); | |
| 61 } | |
| 62 | |
| 63 EndFilterDisplayItem::EndFilterDisplayItem() : DisplayItem(END_FILTER) {} | 55 EndFilterDisplayItem::EndFilterDisplayItem() : DisplayItem(END_FILTER) {} |
| 64 | 56 |
| 65 EndFilterDisplayItem::~EndFilterDisplayItem() {} | 57 EndFilterDisplayItem::~EndFilterDisplayItem() {} |
| 66 | 58 |
| 67 void EndFilterDisplayItem::Raster(SkCanvas* canvas, | 59 void EndFilterDisplayItem::Raster(SkCanvas* canvas, |
| 68 SkPicture::AbortCallback* callback) const { | 60 SkPicture::AbortCallback* callback) const { |
| 69 canvas->restore(); | 61 canvas->restore(); |
| 70 canvas->restore(); | 62 canvas->restore(); |
| 71 } | 63 } |
| 72 | 64 |
| 73 void EndFilterDisplayItem::AsValueInto( | |
| 74 const gfx::Rect& visual_rect, | |
| 75 base::trace_event::TracedValue* array) const { | |
| 76 array->AppendString( | |
| 77 base::StringPrintf("EndFilterDisplayItem visualRect: [%s]", | |
| 78 visual_rect.ToString().c_str())); | |
| 79 } | |
| 80 | |
| 81 } // namespace cc | 65 } // namespace cc |
| OLD | NEW |