OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 SkPixmap_DEFINED | 8 #ifndef SkPixmap_DEFINED |
9 #define SkPixmap_DEFINED | 9 #define SkPixmap_DEFINED |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 SkColorTable* ctable = NULL) | 26 SkColorTable* ctable = NULL) |
27 : fPixels(addr), fCTable(ctable), fRowBytes(rowBytes), fInfo(info) | 27 : fPixels(addr), fCTable(ctable), fRowBytes(rowBytes), fInfo(info) |
28 { | 28 { |
29 if (kIndex_8_SkColorType == info.colorType()) { | 29 if (kIndex_8_SkColorType == info.colorType()) { |
30 SkASSERT(ctable); | 30 SkASSERT(ctable); |
31 } else { | 31 } else { |
32 SkASSERT(NULL == ctable); | 32 SkASSERT(NULL == ctable); |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
| 36 void reset(); |
| 37 void reset(const SkImageInfo& info, const void* addr, size_t rowBytes, |
| 38 SkColorTable* ctable = NULL); |
| 39 |
36 const SkImageInfo& info() const { return fInfo; } | 40 const SkImageInfo& info() const { return fInfo; } |
37 size_t rowBytes() const { return fRowBytes; } | 41 size_t rowBytes() const { return fRowBytes; } |
38 const void* addr() const { return fPixels; } | 42 const void* addr() const { return fPixels; } |
39 SkColorTable* ctable() const { return fCTable; } | 43 SkColorTable* ctable() const { return fCTable; } |
40 | 44 |
41 int width() const { return fInfo.width(); } | 45 int width() const { return fInfo.width(); } |
42 int height() const { return fInfo.height(); } | 46 int height() const { return fInfo.height(); } |
43 SkColorType colorType() const { return fInfo.colorType(); } | 47 SkColorType colorType() const { return fInfo.colorType(); } |
44 SkAlphaType alphaType() const { return fInfo.alphaType(); } | 48 SkAlphaType alphaType() const { return fInfo.alphaType(); } |
45 bool isOpaque() const { return fInfo.isOpaque(); } | 49 bool isOpaque() const { return fInfo.isOpaque(); } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 private: | 162 private: |
159 void (*fUnlockProc)(void*); | 163 void (*fUnlockProc)(void*); |
160 void* fUnlockContext; | 164 void* fUnlockContext; |
161 SkPixmap fPixmap; | 165 SkPixmap fPixmap; |
162 bool fIsLocked; | 166 bool fIsLocked; |
163 | 167 |
164 friend class SkBitmap; | 168 friend class SkBitmap; |
165 }; | 169 }; |
166 | 170 |
167 #endif | 171 #endif |
OLD | NEW |