Home | History | Annotate | Download | only in effects
      1 /*
      2  * Copyright 2012 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 
      8 #ifndef SkSingleInputImageFilter_DEFINED
      9 #define SkSingleInputImageFilter_DEFINED
     10 
     11 #include "SkImageFilter.h"
     12 
     13 class SkMatrix;
     14 struct SkIPoint;
     15 class GrTexture;
     16 
     17 class SK_API SkSingleInputImageFilter : public SkImageFilter {
     18 public:
     19     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSingleInputImageFilter)
     20 
     21 protected:
     22     explicit SkSingleInputImageFilter(SkImageFilter* input);
     23     ~SkSingleInputImageFilter();
     24     explicit SkSingleInputImageFilter(SkFlattenableReadBuffer& rb);
     25     virtual void flatten(SkFlattenableWriteBuffer& wb) const SK_OVERRIDE;
     26 
     27     // Recurses on input (if non-NULL), and returns the processed result,
     28     // otherwise returns src.
     29     SkBitmap getInputResult(Proxy*, const SkBitmap& src, const SkMatrix&,
     30                             SkIPoint* offset);
     31 
     32     SkImageFilter* input() const { return getInput(0); }
     33 private:
     34     typedef SkImageFilter INHERITED;
     35 };
     36 
     37 #endif
     38