diff options
author | egdaniel <egdaniel@google.com> | 2015-06-19 10:52:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-19 10:52:25 -0700 |
commit | 393551e338a3516606ad10b2d6342e16dd3ac610 (patch) | |
tree | 1ddad137445185e185791bcae5085d3d0c6e1aad /src/core/SkConfig8888.h | |
parent | 7054257de9ab53a9daf97e51d5e20178c9604e67 (diff) |
Move rect_memcopy from helper to global static.
BUG=skia:
Review URL: https://codereview.chromium.org/1197713003
Diffstat (limited to 'src/core/SkConfig8888.h')
-rw-r--r-- | src/core/SkConfig8888.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/SkConfig8888.h b/src/core/SkConfig8888.h index 274e3e57c2..954f2b5387 100644 --- a/src/core/SkConfig8888.h +++ b/src/core/SkConfig8888.h @@ -34,4 +34,15 @@ struct SkSrcPixelInfo : SkPixelInfo { bool convertPixelsTo(SkDstPixelInfo* dst, int width, int height) const; }; +static inline void SkRectMemcpy(void* dst, size_t dstRB, const void* src, size_t srcRB, + size_t bytesPerRow, int rowCount) { + SkASSERT(bytesPerRow <= srcRB); + SkASSERT(bytesPerRow <= dstRB); + for (int i = 0; i < rowCount; ++i) { + memcpy(dst, src, bytesPerRow); + dst = (char*)dst + dstRB; + src = (const char*)src + srcRB; + } +} + #endif |