Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: cc/playback/filter_display_item.cc

Issue 2751833007: cc: Move DisplayItem::Raster up to DisplayItemList (Closed)
Patch Set: virtualraster: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/playback/filter_display_item.h ('k') | cc/playback/float_clip_display_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « cc/playback/filter_display_item.h ('k') | cc/playback/float_clip_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698