| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkJSONRenderer.h" | 8 #include "SkJSONRenderer.h" |
| 9 | 9 |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 else if (!strcmp(jsonAlign, SKJSONCANVAS_ALIGN_CENTER)) { | 190 else if (!strcmp(jsonAlign, SKJSONCANVAS_ALIGN_CENTER)) { |
| 191 textAlign = SkPaint::kCenter_Align; | 191 textAlign = SkPaint::kCenter_Align; |
| 192 } | 192 } |
| 193 else if (!strcmp(jsonAlign, SKJSONCANVAS_ALIGN_RIGHT)) { | 193 else if (!strcmp(jsonAlign, SKJSONCANVAS_ALIGN_RIGHT)) { |
| 194 textAlign = SkPaint::kRight_Align; | 194 textAlign = SkPaint::kRight_Align; |
| 195 } | 195 } |
| 196 else { | 196 else { |
| 197 SkASSERT(false); | 197 SkASSERT(false); |
| 198 textAlign = SkPaint::kLeft_Align; | 198 textAlign = SkPaint::kLeft_Align; |
| 199 } | 199 } |
| 200 result->setTextAlign(textAlign); |
| 200 } | 201 } |
| 201 if (jsonPaint.isMember(SKJSONCANVAS_ATTRIBUTE_TEXTSIZE)) { | 202 if (jsonPaint.isMember(SKJSONCANVAS_ATTRIBUTE_TEXTSIZE)) { |
| 202 float textSize = jsonPaint[SKJSONCANVAS_ATTRIBUTE_TEXTSIZE].asFloat(); | 203 float textSize = jsonPaint[SKJSONCANVAS_ATTRIBUTE_TEXTSIZE].asFloat(); |
| 203 result->setTextSize(textSize); | 204 result->setTextSize(textSize); |
| 204 } | 205 } |
| 205 if (jsonPaint.isMember(SKJSONCANVAS_ATTRIBUTE_TEXTSCALEX)) { | 206 if (jsonPaint.isMember(SKJSONCANVAS_ATTRIBUTE_TEXTSCALEX)) { |
| 206 float textScaleX = jsonPaint[SKJSONCANVAS_ATTRIBUTE_TEXTSCALEX].asFloat(
); | 207 float textScaleX = jsonPaint[SKJSONCANVAS_ATTRIBUTE_TEXTSCALEX].asFloat(
); |
| 207 result->setTextScaleX(textScaleX); | 208 result->setTextScaleX(textScaleX); |
| 208 } | 209 } |
| 209 if (jsonPaint.isMember(SKJSONCANVAS_ATTRIBUTE_TEXTSKEWX)) { | 210 if (jsonPaint.isMember(SKJSONCANVAS_ATTRIBUTE_TEXTSKEWX)) { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 renderer.processCommand(commands[i], target); | 451 renderer.processCommand(commands[i], target); |
| 451 } | 452 } |
| 452 } | 453 } |
| 453 else { | 454 else { |
| 454 SkDebugf(json); | 455 SkDebugf(json); |
| 455 SkFAIL("json parse failure"); | 456 SkFAIL("json parse failure"); |
| 456 } | 457 } |
| 457 } | 458 } |
| 458 | 459 |
| 459 } // namespace | 460 } // namespace |
| OLD | NEW |