blob: 7d11d689e16de30713e2aedae35a6c63140744f2 [file] [log] [blame]
// Copyright 2013 The Chromium 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 "base/values.h"
#include "third_party/skia/include/core/SkDrawFilter.h"
class SkPaint;
namespace skia {
// This filter allows setting an opacity on every draw call to a canvas, and to
// disable image filtering. Note that the opacity setting is only correct in
// very limited conditions: when there is only zero or one opaque, nonlayer
// draw for every pixel in the surface.
class SK_API OpacityDrawFilter : public SkDrawFilter {
OpacityDrawFilter(float opacity, bool disable_image_filtering);
~OpacityDrawFilter() override;
bool filter(SkPaint* paint, SkDrawFilter::Type type) override;
int alpha_;
bool disable_image_filtering_;
} // namespace skia