| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 std::unique_ptr<JSONArray> arrayForSkScalars(size_t n, | 488 std::unique_ptr<JSONArray> arrayForSkScalars(size_t n, |
| 489 const SkScalar scalars[]) { | 489 const SkScalar scalars[]) { |
| 490 std::unique_ptr<JSONArray> scalarsArray = JSONArray::create(); | 490 std::unique_ptr<JSONArray> scalarsArray = JSONArray::create(); |
| 491 for (size_t i = 0; i < n; ++i) | 491 for (size_t i = 0; i < n; ++i) |
| 492 scalarsArray->pushDouble(scalars[i]); | 492 scalarsArray->pushDouble(scalars[i]); |
| 493 return scalarsArray; | 493 return scalarsArray; |
| 494 } | 494 } |
| 495 | 495 |
| 496 String clipOpName(SkClipOp op) { | 496 String clipOpName(SkClipOp op) { |
| 497 switch (op) { | 497 switch (op) { |
| 498 case kDifference_SkClipOp: | 498 case SkClipOp::kDifference: |
| 499 return "kDifference_Op"; | 499 return "kDifference_Op"; |
| 500 case kIntersect_SkClipOp: | 500 case SkClipOp::kIntersect: |
| 501 return "kIntersect_Op"; | 501 return "kIntersect_Op"; |
| 502 case kUnion_SkClipOp: | 502 case SkClipOp::kUnion: |
| 503 return "kUnion_Op"; | 503 return "kUnion_Op"; |
| 504 case kXOR_SkClipOp: | 504 case SkClipOp::kXOR: |
| 505 return "kXOR_Op"; | 505 return "kXOR_Op"; |
| 506 case kReverseDifference_SkClipOp: | 506 case SkClipOp::kReverseDifference: |
| 507 return "kReverseDifference_Op"; | 507 return "kReverseDifference_Op"; |
| 508 case kReplace_SkClipOp: | 508 case SkClipOp::kReplace: |
| 509 return "kReplace_Op"; | 509 return "kReplace_Op"; |
| 510 default: | 510 default: |
| 511 return "Unknown type"; | 511 return "Unknown type"; |
| 512 }; | 512 }; |
| 513 } | 513 } |
| 514 | 514 |
| 515 String saveLayerFlagsToString(SkCanvas::SaveLayerFlags flags) { | 515 String saveLayerFlagsToString(SkCanvas::SaveLayerFlags flags) { |
| 516 String flagsString = ""; | 516 String flagsString = ""; |
| 517 if (flags & SkCanvas::kIsOpaque_SaveLayerFlag) | 517 if (flags & SkCanvas::kIsOpaque_SaveLayerFlag) |
| 518 flagsString.append("kIsOpaque_SaveLayerFlag "); | 518 flagsString.append("kIsOpaque_SaveLayerFlag "); |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 pictureAsJSON->setArray("operations", canvas.log()); | 932 pictureAsJSON->setArray("operations", canvas.log()); |
| 933 return pictureAsJSON->toPrettyJSONString(); | 933 return pictureAsJSON->toPrettyJSONString(); |
| 934 } | 934 } |
| 935 | 935 |
| 936 void showSkPicture(const SkPicture* picture) { | 936 void showSkPicture(const SkPicture* picture) { |
| 937 WTFLogAlways("%s\n", pictureAsDebugString(picture).utf8().data()); | 937 WTFLogAlways("%s\n", pictureAsDebugString(picture).utf8().data()); |
| 938 } | 938 } |
| 939 #endif | 939 #endif |
| 940 | 940 |
| 941 } // namespace blink | 941 } // namespace blink |
| OLD | NEW |