Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkDataPixelRef_DEFINED | 8 #ifndef SkDataPixelRef_DEFINED |
| 9 #define SkDataPixelRef_DEFINED | 9 #define SkDataPixelRef_DEFINED |
| 10 | 10 |
| 11 #include "SkPixelRef.h" | 11 #include "SkPixelRef.h" |
| 12 | 12 |
| 13 class SkData; | 13 class SkData; |
| 14 | 14 |
| 15 class SkDataPixelRef : public SkPixelRef { | 15 class SkDataPixelRef : public SkPixelRef { |
| 16 public: | 16 public: |
| 17 SkDataPixelRef(SkData* data); | 17 SkDataPixelRef(const SkImageInfo&, SkData* data, size_t rowBytes); |
| 18 virtual ~SkDataPixelRef(); | 18 virtual ~SkDataPixelRef(); |
| 19 | 19 |
| 20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDataPixelRef) | 20 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDataPixelRef) |
| 21 | 21 |
| 22 protected: | 22 protected: |
| 23 virtual void* onLockPixels(SkColorTable**) SK_OVERRIDE; | 23 virtual void* onLockPixels(SkImageInfo*, size_t* rowBytes, |
| 24 SkColorTable**) SK_OVERRIDE; | |
| 24 virtual void onUnlockPixels() SK_OVERRIDE; | 25 virtual void onUnlockPixels() SK_OVERRIDE; |
| 25 | 26 |
| 26 SkDataPixelRef(SkFlattenableReadBuffer& buffer); | 27 SkDataPixelRef(SkFlattenableReadBuffer& buffer); |
| 27 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 28 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 SkData* fData; | 31 SkImageInfo fInfo; |
|
scroggo
2013/11/19 18:17:09
Can these be const?
reed1
2013/11/20 20:56:56
nope, since they get set late in the unflattening
| |
| 32 SkData* fData; | |
| 33 size_t fRB; | |
| 31 | 34 |
| 32 typedef SkPixelRef INHERITED; | 35 typedef SkPixelRef INHERITED; |
| 33 }; | 36 }; |
| 34 | 37 |
| 35 #endif | 38 #endif |
| OLD | NEW |