| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkDisplayTypes.h" | 10 #include "SkDisplayTypes.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 SkDisplayString::SkDisplayString() { | 115 SkDisplayString::SkDisplayString() { |
| 116 } | 116 } |
| 117 | 117 |
| 118 SkDisplayString::SkDisplayString(SkString& copyFrom) : value(copyFrom) { | 118 SkDisplayString::SkDisplayString(SkString& copyFrom) : value(copyFrom) { |
| 119 } | 119 } |
| 120 | 120 |
| 121 void SkDisplayString::executeFunction(SkDisplayable* target, int index, | 121 void SkDisplayString::executeFunction(SkDisplayable* target, int index, |
| 122 SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type, | 122 SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type, |
| 123 SkScriptValue* scriptValue) { | 123 SkScriptValue* scriptValue) { |
| 124 if (scriptValue == NULL) | 124 if (scriptValue == nullptr) |
| 125 return; | 125 return; |
| 126 SkASSERT(target == this); | 126 SkASSERT(target == this); |
| 127 switch (index) { | 127 switch (index) { |
| 128 case SK_FUNCTION(slice): | 128 case SK_FUNCTION(slice): |
| 129 scriptValue->fType = SkType_String; | 129 scriptValue->fType = SkType_String; |
| 130 SkASSERT(parameters[0].fType == SkType_Int); | 130 SkASSERT(parameters[0].fType == SkType_Int); |
| 131 int start = parameters[0].fOperand.fS32; | 131 int start = parameters[0].fOperand.fS32; |
| 132 if (start < 0) | 132 if (start < 0) |
| 133 start = (int) (value.size() - start); | 133 start = (int) (value.size() - start); |
| 134 int end = (int) value.size(); | 134 int end = (int) value.size(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 case SK_PROPERTY(length): | 205 case SK_PROPERTY(length): |
| 206 value->fType = SkType_Int; | 206 value->fType = SkType_Int; |
| 207 value->fOperand.fS32 = values.count(); | 207 value->fOperand.fS32 = values.count(); |
| 208 break; | 208 break; |
| 209 default: | 209 default: |
| 210 SkASSERT(0); | 210 SkASSERT(0); |
| 211 return false; | 211 return false; |
| 212 } | 212 } |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| OLD | NEW |