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

Unified Diff: src/core/SkConfig8888.cpp

Issue 1703013002: misc fixes to make float buffers work a little better (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « src/core/SkBlitter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkConfig8888.cpp
diff --git a/src/core/SkConfig8888.cpp b/src/core/SkConfig8888.cpp
index 53f35c37374666fbc92e146846b374c708aef234..e2dd1020deaef9b322eb40b93780442210622a5f 100644
--- a/src/core/SkConfig8888.cpp
+++ b/src/core/SkConfig8888.cpp
@@ -173,9 +173,20 @@ bool SkPixelInfo::CopyPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t
if (srcInfo.dimensions() != dstInfo.dimensions()) {
return false;
}
-
+
const int width = srcInfo.width();
const int height = srcInfo.height();
+
+ // Do the easiest one first : both configs are equal
+ if ((srcInfo == dstInfo) && !ctable) {
+ size_t bytes = width * srcInfo.bytesPerPixel();
+ for (int y = 0; y < height; ++y) {
+ memcpy(dstPixels, srcPixels, bytes);
+ srcPixels = (const char*)srcPixels + srcRB;
+ dstPixels = (char*)dstPixels + dstRB;
+ }
+ return true;
+ }
// Handle fancy alpha swizzling if both are ARGB32
if (4 == srcInfo.bytesPerPixel() && 4 == dstInfo.bytesPerPixel()) {
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698