| Index: cc/playback/filter_display_item.cc
|
| diff --git a/cc/playback/filter_display_item.cc b/cc/playback/filter_display_item.cc
|
| index 8bf8e6a498a918c30e5d2b09a930c449112aaf86..0ad6db5d7be0b91f8e04b9d49648861476c6004e 100644
|
| --- a/cc/playback/filter_display_item.cc
|
| +++ b/cc/playback/filter_display_item.cc
|
| @@ -4,62 +4,17 @@
|
|
|
| #include "cc/playback/filter_display_item.h"
|
|
|
| -#include <stddef.h>
|
| -
|
| -#include "base/strings/stringprintf.h"
|
| -#include "base/trace_event/trace_event_argument.h"
|
| -#include "cc/output/render_surface_filters.h"
|
| -#include "third_party/skia/include/core/SkCanvas.h"
|
| -#include "third_party/skia/include/core/SkImageFilter.h"
|
| -#include "third_party/skia/include/core/SkPaint.h"
|
| -#include "third_party/skia/include/core/SkRefCnt.h"
|
| -#include "ui/gfx/skia_util.h"
|
| -
|
| namespace cc {
|
|
|
| FilterDisplayItem::FilterDisplayItem(const FilterOperations& filters,
|
| const gfx::RectF& bounds,
|
| const gfx::PointF& origin)
|
| - : DisplayItem(FILTER) {
|
| - SetNew(filters, bounds, origin);
|
| -}
|
| -
|
| -FilterDisplayItem::~FilterDisplayItem() {}
|
| -
|
| -void FilterDisplayItem::SetNew(const FilterOperations& filters,
|
| - const gfx::RectF& bounds,
|
| - const gfx::PointF& origin) {
|
| - filters_ = filters;
|
| - bounds_ = bounds;
|
| - origin_ = origin;
|
| -}
|
| + : DisplayItem(FILTER), filters(filters), bounds(bounds), origin(origin) {}
|
|
|
| -void FilterDisplayItem::Raster(SkCanvas* canvas,
|
| - SkPicture::AbortCallback* callback) const {
|
| - canvas->save();
|
| - canvas->translate(origin_.x(), origin_.y());
|
| -
|
| - sk_sp<SkImageFilter> image_filter = RenderSurfaceFilters::BuildImageFilter(
|
| - filters_, gfx::SizeF(bounds_.width(), bounds_.height()));
|
| - SkRect boundaries = RectFToSkRect(bounds_);
|
| - boundaries.offset(-origin_.x(), -origin_.y());
|
| -
|
| - SkPaint paint;
|
| - paint.setBlendMode(SkBlendMode::kSrcOver);
|
| - paint.setImageFilter(std::move(image_filter));
|
| - canvas->saveLayer(&boundaries, &paint);
|
| -
|
| - canvas->translate(-origin_.x(), -origin_.y());
|
| -}
|
| +FilterDisplayItem::~FilterDisplayItem() = default;
|
|
|
| EndFilterDisplayItem::EndFilterDisplayItem() : DisplayItem(END_FILTER) {}
|
|
|
| -EndFilterDisplayItem::~EndFilterDisplayItem() {}
|
| -
|
| -void EndFilterDisplayItem::Raster(SkCanvas* canvas,
|
| - SkPicture::AbortCallback* callback) const {
|
| - canvas->restore();
|
| - canvas->restore();
|
| -}
|
| +EndFilterDisplayItem::~EndFilterDisplayItem() = default;
|
|
|
| } // namespace cc
|
|
|