diff options
Diffstat (limited to 'include/effects/Sk2DPathEffect.h')
-rw-r--r-- | include/effects/Sk2DPathEffect.h | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/include/effects/Sk2DPathEffect.h b/include/effects/Sk2DPathEffect.h index 02ec760..b5d7fbb 100644 --- a/include/effects/Sk2DPathEffect.h +++ b/include/effects/Sk2DPathEffect.h @@ -1,40 +1,29 @@ + /* - * Copyright (C) 2006 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 + * Copyright 2006 The Android Open Source Project * - * 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. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + #ifndef Sk2DPathEffect_DEFINED #define Sk2DPathEffect_DEFINED +#include "SkPath.h" #include "SkPathEffect.h" #include "SkMatrix.h" -// This class is not exported to java. class Sk2DPathEffect : public SkPathEffect { public: Sk2DPathEffect(const SkMatrix& mat); // overrides - // This method is not exported to java. - virtual bool filterPath(SkPath* dst, const SkPath& src, SkScalar* width); + virtual bool filterPath(SkPath*, const SkPath&, SkScalar* width) SK_OVERRIDE; // overrides from SkFlattenable - // This method is not exported to java. - virtual void flatten(SkFlattenableWriteBuffer&); - - // This method is not exported to java. - virtual Factory getFactory(); + virtual void flatten(SkFlattenableWriteBuffer&) SK_OVERRIDE; + virtual Factory getFactory() SK_OVERRIDE; protected: /** New virtual, to be overridden by subclasses. @@ -58,6 +47,8 @@ protected: // protected so that subclasses can call this during unflattening Sk2DPathEffect(SkFlattenableReadBuffer&); + SK_DECLARE_FLATTENABLE_REGISTRAR() + private: SkMatrix fMatrix, fInverse; // illegal @@ -70,4 +61,30 @@ private: typedef SkPathEffect INHERITED; }; +class SkPath2DPathEffect : public Sk2DPathEffect { +public: + /** + * Stamp the specified path to fill the shape, using the matrix to define + * the latice. + */ + SkPath2DPathEffect(const SkMatrix&, const SkPath&); + + static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); + + SK_DECLARE_FLATTENABLE_REGISTRAR() + +protected: + SkPath2DPathEffect(SkFlattenableReadBuffer& buffer); + + virtual void flatten(SkFlattenableWriteBuffer&) SK_OVERRIDE; + virtual Factory getFactory() SK_OVERRIDE; + virtual void next(const SkPoint&, int u, int v, SkPath* dst) SK_OVERRIDE; + +private: + SkPath fPath; + + typedef Sk2DPathEffect INHERITED; +}; + + #endif |