Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: src/core/SkConfig8888.h

Issue 1197713003: Move rect_memcopy from helper to global static. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkConfig8888.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkConfig8888.h
diff --git a/src/core/SkConfig8888.h b/src/core/SkConfig8888.h
index 274e3e57c2b37aa009aa425256224023a4b6ff8f..954f2b53874f9e194097561bd6e291ee1bf7793b 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
« no previous file with comments | « no previous file | src/core/SkConfig8888.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698