blob: c8af187056e7e0309bad224ac2c1a95210b0a96b [file] [log] [blame]
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SkDrawFilter_DEFINED
#define SkDrawFilter_DEFINED
#include "SkRefCnt.h"
class SkCanvas;
class SkPaint;
/**
* Right before something is being draw, filter() is called with the
* paint. The filter may modify the paint as it wishes, which will then be
* used for the actual drawing. Note: this modification only lasts for the
* current draw, as a temporary copy of the paint is used.
*/
class SkDrawFilter : public SkRefCnt {
public:
enum Type {
kPaint_Type,
kPoint_Type,
kLine_Type,
kBitmap_Type,
kRect_Type,
kPath_Type,
kText_Type
};
/**
* Called with the paint that will be used to draw the specified type.
* The implementation may modify the paint as they wish.
*/
virtual void filter(SkPaint*, Type) = 0;
};
#endif