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 30 matching lines...) Expand all Loading... |
41 size_t rowBytes() const { return fRowBytes; } | 41 size_t rowBytes() const { return fRowBytes; } |
42 const void* addr() const { return fPixels; } | 42 const void* addr() const { return fPixels; } |
43 SkColorTable* ctable() const { return fCTable; } | 43 SkColorTable* ctable() const { return fCTable; } |
44 | 44 |
45 int width() const { return fInfo.width(); } | 45 int width() const { return fInfo.width(); } |
46 int height() const { return fInfo.height(); } | 46 int height() const { return fInfo.height(); } |
47 SkColorType colorType() const { return fInfo.colorType(); } | 47 SkColorType colorType() const { return fInfo.colorType(); } |
48 SkAlphaType alphaType() const { return fInfo.alphaType(); } | 48 SkAlphaType alphaType() const { return fInfo.alphaType(); } |
49 bool isOpaque() const { return fInfo.isOpaque(); } | 49 bool isOpaque() const { return fInfo.isOpaque(); } |
50 | 50 |
| 51 SkIRect bounds() const { return SkIRect::MakeWH(this->width(), this->height(
)); } |
| 52 |
51 uint64_t getSize64() const { return sk_64_mul(fInfo.height(), fRowBytes); } | 53 uint64_t getSize64() const { return sk_64_mul(fInfo.height(), fRowBytes); } |
52 uint64_t getSafeSize64() const { return fInfo.getSafeSize64(fRowBytes); } | 54 uint64_t getSafeSize64() const { return fInfo.getSafeSize64(fRowBytes); } |
53 size_t getSafeSize() const { return fInfo.getSafeSize(fRowBytes); } | 55 size_t getSafeSize() const { return fInfo.getSafeSize(fRowBytes); } |
54 | 56 |
55 const uint32_t* addr32() const { | 57 const uint32_t* addr32() const { |
56 SkASSERT(4 == SkColorTypeBytesPerPixel(fInfo.colorType())); | 58 SkASSERT(4 == SkColorTypeBytesPerPixel(fInfo.colorType())); |
57 return reinterpret_cast<const uint32_t*>(fPixels); | 59 return reinterpret_cast<const uint32_t*>(fPixels); |
58 } | 60 } |
59 | 61 |
60 const uint16_t* addr16() const { | 62 const uint16_t* addr16() const { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 private: | 164 private: |
163 void (*fUnlockProc)(void*); | 165 void (*fUnlockProc)(void*); |
164 void* fUnlockContext; | 166 void* fUnlockContext; |
165 SkPixmap fPixmap; | 167 SkPixmap fPixmap; |
166 bool fIsLocked; | 168 bool fIsLocked; |
167 | 169 |
168 friend class SkBitmap; | 170 friend class SkBitmap; |
169 }; | 171 }; |
170 | 172 |
171 #endif | 173 #endif |
OLD | NEW |