Move color processing to JS

Reviewed By: @vjeux

Differential Revision: D2346353
This commit is contained in:
Alexsander Akers
2015-09-17 08:36:08 -07:00
committed by facebook-github-bot-7
parent 6078a4f865
commit 9a2d05d9b2
17 changed files with 292 additions and 424 deletions

View File

@@ -158,13 +158,23 @@ ReactNativeBaseComponent.Mixin = {
validAttributes
);
for (var key in updatePayload) {
var process = validAttributes[key] && validAttributes[key].process;
if (process) {
updatePayload[key] = process(updatePayload[key]);
}
}
// The style property is a deeply nested element which includes numbers
// to represent static objects. Most of the time, it doesn't change across
// renders, so it's faster to spend the time checking if it is different
// before actually doing the expensive flattening operation in order to
// compute the diff.
if (styleDiffer(nextProps.style, prevProps.style)) {
var nextFlattenedStyle = precomputeStyle(flattenStyle(nextProps.style));
var nextFlattenedStyle = precomputeStyle(
flattenStyle(nextProps.style),
this.viewConfig.validAttributes
);
updatePayload = diffRawProperties(
updatePayload,
this.previousFlattenedStyle,