blob: 50c885714b91f1c3b3c389b441363a2d499ca707 [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:
reed@google.com398337b2013-12-11 21:22:39 +000017 SkDataPixelRef(SkData* data);
reed@google.comf6627b72012-07-27 18:02:50 +000018 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:
reed@google.com398337b2013-12-11 21:22:39 +000023 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE;
reed@google.comf6627b72012-07-27 18:02:50 +000024 virtual void onUnlockPixels() SK_OVERRIDE;
commit-bot@chromium.orgcd3b15c2013-12-04 17:06:49 +000025 virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000026
reed@google.comf6627b72012-07-27 18:02:50 +000027 SkDataPixelRef(SkFlattenableReadBuffer& buffer);
28 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000029
reed@google.comf6627b72012-07-27 18:02:50 +000030private:
reed@google.com398337b2013-12-11 21:22:39 +000031 SkData* fData;
rmistry@google.comfbfcd562012-08-23 18:09:54 +000032
reed@google.comf6627b72012-07-27 18:02:50 +000033 typedef SkPixelRef INHERITED;
34};
35
36#endif