blob: 6b15802b97c965b08e08211104c51eb96f2d2332 [file] [log] [blame]
reed@google.comf6627b72012-07-27 18:02:50 +00001/*
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 SkDataPixelRef_DEFINED
9#define SkDataPixelRef_DEFINED
10
11#include "SkPixelRef.h"
12
13class SkData;
14
15class SkDataPixelRef : public SkPixelRef {
16public:
17 SkDataPixelRef(SkData* data);
18 virtual ~SkDataPixelRef();
rmistry@google.comfbfcd562012-08-23 18:09:54 +000019
reed@google.comf6627b72012-07-27 18:02:50 +000020 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDataPixelRef)
rmistry@google.comfbfcd562012-08-23 18:09:54 +000021
reed@google.comf6627b72012-07-27 18:02:50 +000022protected:
23 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE;
24 virtual void onUnlockPixels() SK_OVERRIDE;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000025
reed@google.comf6627b72012-07-27 18:02:50 +000026 SkDataPixelRef(SkFlattenableReadBuffer& buffer);
27 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000028
reed@google.comf6627b72012-07-27 18:02:50 +000029private:
30 SkData* fData;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000031
reed@google.comf6627b72012-07-27 18:02:50 +000032 typedef SkPixelRef INHERITED;
33};
34
35#endif