diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-13 14:22:17 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-13 14:22:17 +0000 |
commit | 82aa7482cbf55ce6d42c692550cadee5e23146e4 (patch) | |
tree | cf208c1d3e82a2288236d1591b1b85e3870371a9 /include/effects/SkMagnifierImageFilter.h | |
parent | 3ada0efdc8de8316df8113ec54ffd1a3f33ecd21 (diff) |
Add a zoom filter to Skia. This will be used on ChromeOS to implement the screen magnifier.
Committed on behalf of zork@chromium.org
Review URL: http://codereview.appspot.com/6354065/
git-svn-id: http://skia.googlecode.com/svn/trunk@5056 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects/SkMagnifierImageFilter.h')
-rw-r--r-- | include/effects/SkMagnifierImageFilter.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/effects/SkMagnifierImageFilter.h b/include/effects/SkMagnifierImageFilter.h new file mode 100644 index 0000000000..144fdb42ca --- /dev/null +++ b/include/effects/SkMagnifierImageFilter.h @@ -0,0 +1,37 @@ +/* + * Copyright 2012 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + + +#ifndef SkMagnifierImageFilter_DEFINED +#define SkMagnifierImageFilter_DEFINED + +#include "SkRect.h" +#include "SkImageFilter.h" + +class SK_API SkMagnifierImageFilter : public SkImageFilter { +public: + SkMagnifierImageFilter(SkRect srcRect, SkScalar inset); + + virtual bool asNewCustomStage(GrCustomStage** stage, + GrTexture* texture) const SK_OVERRIDE; + + SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter) + +protected: + explicit SkMagnifierImageFilter(SkFlattenableReadBuffer& buffer); + virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; + + virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, + SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; + +private: + SkRect fSrcRect; + SkScalar fInset; + typedef SkImageFilter INHERITED; +}; + +#endif |