SkBitmapSource.h revision 6806fe87e0b39e283291c1a1c7d1d864230aa2aa
1/*
2 * Copyright 2012 The Android Open Source Project
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 SkBitmapSource_DEFINED
9#define SkBitmapSource_DEFINED
10
11#include "SkImageFilter.h"
12#include "SkBitmap.h"
13
14class SK_API SkBitmapSource : public SkImageFilter {
15public:
16    explicit SkBitmapSource(const SkBitmap& bitmap);
17
18    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapSource)
19
20protected:
21    explicit SkBitmapSource(SkFlattenableReadBuffer& buffer);
22    virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
23    virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
24                               SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
25
26private:
27    SkBitmap fBitmap;
28    typedef SkImageFilter INHERITED;
29};
30
31#endif
32