OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 SkPixelInfo_DEFINED | 8 #ifndef SkPixelInfo_DEFINED |
9 #define SkPixelInfo_DEFINED | 9 #define SkPixelInfo_DEFINED |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 }; | 27 }; |
28 | 28 |
29 struct SkSrcPixelInfo : SkPixelInfo { | 29 struct SkSrcPixelInfo : SkPixelInfo { |
30 const void* fPixels; | 30 const void* fPixels; |
31 | 31 |
32 // Guaranteed to work even if src.fPixels and dst.fPixels are the same | 32 // Guaranteed to work even if src.fPixels and dst.fPixels are the same |
33 // (but not if they overlap partially) | 33 // (but not if they overlap partially) |
34 bool convertPixelsTo(SkDstPixelInfo* dst, int width, int height) const; | 34 bool convertPixelsTo(SkDstPixelInfo* dst, int width, int height) const; |
35 }; | 35 }; |
36 | 36 |
| 37 static inline void SkRectMemcpy(void* dst, size_t dstRB, const void* src, size_t
srcRB, |
| 38 size_t bytesPerRow, int rowCount) { |
| 39 SkASSERT(bytesPerRow <= srcRB); |
| 40 SkASSERT(bytesPerRow <= dstRB); |
| 41 for (int i = 0; i < rowCount; ++i) { |
| 42 memcpy(dst, src, bytesPerRow); |
| 43 dst = (char*)dst + dstRB; |
| 44 src = (const char*)src + srcRB; |
| 45 } |
| 46 } |
| 47 |
37 #endif | 48 #endif |
OLD | NEW |