blob: c52bcdc28f407da683692ea0584007fea5b958ca [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/flow/layers/color_filter_layer.h"
namespace flutter {
ColorFilterLayer::ColorFilterLayer() = default;
ColorFilterLayer::~ColorFilterLayer() = default;
void ColorFilterLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ColorFilterLayer::Paint");
FML_DCHECK(needs_painting());
SkPaint paint;
paint.setColorFilter(SkColorFilters::Blend(color_, blend_mode_));
Layer::AutoSaveLayer save =
Layer::AutoSaveLayer::Create(context, paint_bounds(), &paint);
PaintChildren(context);
}
} // namespace flutter