| 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 |
| 11 #include "SkImageInfo.h" | 11 #include "SkImageInfo.h" |
| 12 | 12 |
| 13 class SkColorTable; |
| 14 |
| 13 struct SkPixelInfo { | 15 struct SkPixelInfo { |
| 14 SkColorType fColorType; | 16 SkColorType fColorType; |
| 15 SkAlphaType fAlphaType; | 17 SkAlphaType fAlphaType; |
| 16 size_t fRowBytes; | 18 size_t fRowBytes; |
| 17 | 19 |
| 18 static bool CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t d
stRowBytes, | 20 static bool CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t d
stRowBytes, |
| 19 const SkImageInfo& srcInfo, const void* srcPixels, si
ze_t srcRowBytes, | 21 const SkImageInfo& srcInfo, const void* srcPixels, si
ze_t srcRowBytes, |
| 20 SkColorTable* srcCTable = NULL); | 22 SkColorTable* srcCTable = NULL); |
| 21 }; | 23 }; |
| 22 | 24 |
| 23 struct SkDstPixelInfo : SkPixelInfo { | 25 struct SkDstPixelInfo : SkPixelInfo { |
| 24 void* fPixels; | 26 void* fPixels; |
| 25 }; | 27 }; |
| 26 | 28 |
| 27 struct SkSrcPixelInfo : SkPixelInfo { | 29 struct SkSrcPixelInfo : SkPixelInfo { |
| 28 const void* fPixels; | 30 const void* fPixels; |
| 29 | 31 |
| 30 // 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 |
| 31 // (but not if they overlap partially) | 33 // (but not if they overlap partially) |
| 32 bool convertPixelsTo(SkDstPixelInfo* dst, int width, int height) const; | 34 bool convertPixelsTo(SkDstPixelInfo* dst, int width, int height) const; |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 #endif | 37 #endif |
| OLD | NEW |