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

Unified Diff: src/core/SkColorSpace.cpp

Issue 1952063002: Create SkColorSpaceXform to handle color conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Multiply by the inverse of 255.0f Created 4 years, 7 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
Index: src/core/SkColorSpace.cpp
diff --git a/src/core/SkColorSpace.cpp b/src/core/SkColorSpace.cpp
index 55ab4c177a57f77a57e09989f6ea584436262d54..c1b5e4435538ada8a2e01dc4515cdc61625aa1cb 100644
--- a/src/core/SkColorSpace.cpp
+++ b/src/core/SkColorSpace.cpp
@@ -322,7 +322,7 @@ bool SkColorSpace::LoadGammas(SkGammaCurve* gammas, uint32_t numGammas, const ui
// The table entry is the gamma (with a bias of 256).
uint16_t value = read_big_endian_short((const uint8_t*) table);
gammas[i].fValue = value / 256.0f;
- SkColorSpacePrintf("gamma %d %g\n", value, *gamma);
+ SkColorSpacePrintf("gamma %d %g\n", value, gammas[i].fValue);
break;
}
@@ -371,7 +371,7 @@ bool SkColorSpace::LoadGammas(SkGammaCurve* gammas, uint32_t numGammas, const ui
}
// Adjust src and len if there is another gamma curve to load.
- if (0 != numGammas) {
+ if (i != numGammas - 1) {
// Each curve is padded to 4-byte alignment.
tagBytes = SkAlign4(tagBytes);
if (len < tagBytes) {
« dm/DMSrcSink.cpp ('K') | « src/core/SkColorSpace.h ('k') | src/core/SkColorSpaceXform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698