blob: b141ec83e3a010573accff62dff00c5f1f1d3925 [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/clip_rect_layer.h"
namespace flutter {
ClipRectLayer::ClipRectLayer(const SkRect& clip_rect, Clip clip_behavior)
: ClipShapeLayer(clip_rect, clip_behavior) {}
const SkRect& ClipRectLayer::clip_shape_bounds() const {
return clip_shape();
}
void ClipRectLayer::ApplyClip(LayerStateStack::MutatorContext& mutator) const {
mutator.clipRect(clip_shape(), clip_behavior() != Clip::hardEdge);
}
} // namespace flutter