reed@google.com | f6627b7 | 2012-07-27 18:02:50 +0000 | [diff] [blame] | 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 SkDataPixelRef_DEFINED |
| 9 | #define SkDataPixelRef_DEFINED |
| 10 | |
| 11 | #include "SkPixelRef.h" |
| 12 | |
| 13 | class SkData; |
| 14 | |
| 15 | class SkDataPixelRef : public SkPixelRef { |
| 16 | public: |
| 17 | SkDataPixelRef(SkData* data); |
| 18 | virtual ~SkDataPixelRef(); |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 19 | |
reed@google.com | f6627b7 | 2012-07-27 18:02:50 +0000 | [diff] [blame] | 20 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDataPixelRef) |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 21 | |
reed@google.com | f6627b7 | 2012-07-27 18:02:50 +0000 | [diff] [blame] | 22 | protected: |
| 23 | virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE; |
| 24 | virtual void onUnlockPixels() SK_OVERRIDE; |
commit-bot@chromium.org | cd3b15c | 2013-12-04 17:06:49 +0000 | [diff] [blame^] | 25 | virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE; |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 26 | |
reed@google.com | f6627b7 | 2012-07-27 18:02:50 +0000 | [diff] [blame] | 27 | SkDataPixelRef(SkFlattenableReadBuffer& buffer); |
| 28 | virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 29 | |
reed@google.com | f6627b7 | 2012-07-27 18:02:50 +0000 | [diff] [blame] | 30 | private: |
| 31 | SkData* fData; |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 32 | |
reed@google.com | f6627b7 | 2012-07-27 18:02:50 +0000 | [diff] [blame] | 33 | typedef SkPixelRef INHERITED; |
| 34 | }; |
| 35 | |
| 36 | #endif |