| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 m_canvas->m_depthCount--; | 77 m_canvas->m_depthCount--; |
| 78 if (!m_canvas->m_depthCount) | 78 if (!m_canvas->m_depthCount) |
| 79 m_canvas->m_log->pushObject(m_logItem); | 79 m_canvas->m_log->pushObject(m_logItem); |
| 80 } | 80 } |
| 81 | 81 |
| 82 LoggingCanvas::LoggingCanvas(int width, int height) : InterceptingCanvas(width,
height) | 82 LoggingCanvas::LoggingCanvas(int width, int height) : InterceptingCanvas(width,
height) |
| 83 { | 83 { |
| 84 m_log = JSONArray::create(); | 84 m_log = JSONArray::create(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void LoggingCanvas::clear(SkColor color) | |
| 88 { | |
| 89 AutoLogger logger(this); | |
| 90 logger.logItemWithParams("clear")->setString("color", stringForSkColor(color
)); | |
| 91 this->SkCanvas::clear(color); | |
| 92 } | |
| 93 | |
| 94 void LoggingCanvas::drawPaint(const SkPaint& paint) | 87 void LoggingCanvas::drawPaint(const SkPaint& paint) |
| 95 { | 88 { |
| 96 AutoLogger logger(this); | 89 AutoLogger logger(this); |
| 97 logger.logItemWithParams("drawPaint")->setObject("paint", objectForSkPaint(p
aint)); | 90 logger.logItemWithParams("drawPaint")->setObject("paint", objectForSkPaint(p
aint)); |
| 98 this->SkCanvas::drawPaint(paint); | 91 this->SkCanvas::drawPaint(paint); |
| 99 } | 92 } |
| 100 | 93 |
| 101 void LoggingCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[]
, const SkPaint& paint) | 94 void LoggingCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[]
, const SkPaint& paint) |
| 102 { | 95 { |
| 103 AutoLogger logger(this); | 96 AutoLogger logger(this); |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 paint.glyphsToUnichars(static_cast<const uint16_t*>(text), byteLength /
2, textData); | 878 paint.glyphsToUnichars(static_cast<const uint16_t*>(text), byteLength /
2, textData); |
| 886 return WTF::UTF32LittleEndianEncoding().decode(reinterpret_cast<const ch
ar*>(textData), byteLength * 2); | 879 return WTF::UTF32LittleEndianEncoding().decode(reinterpret_cast<const ch
ar*>(textData), byteLength * 2); |
| 887 } | 880 } |
| 888 default: | 881 default: |
| 889 ASSERT_NOT_REACHED(); | 882 ASSERT_NOT_REACHED(); |
| 890 return "?"; | 883 return "?"; |
| 891 } | 884 } |
| 892 } | 885 } |
| 893 | 886 |
| 894 } // namespace blink | 887 } // namespace blink |
| OLD | NEW |