| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkRecorder.h" | 8 #include "SkRecorder.h" |
| 9 #include "SkPatchUtils.h" | 9 #include "SkPatchUtils.h" |
| 10 #include "SkPicture.h" | 10 #include "SkPicture.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return dst; | 111 return dst; |
| 112 } | 112 } |
| 113 | 113 |
| 114 // As above, assuming and copying a terminating \0. | 114 // As above, assuming and copying a terminating \0. |
| 115 template <> | 115 template <> |
| 116 char* SkRecorder::copy(const char* src) { | 116 char* SkRecorder::copy(const char* src) { |
| 117 return this->copy(src, strlen(src)+1); | 117 return this->copy(src, strlen(src)+1); |
| 118 } | 118 } |
| 119 | 119 |
| 120 | 120 |
| 121 void SkRecorder::clear(SkColor color) { |
| 122 APPEND(Clear, color); |
| 123 } |
| 124 |
| 121 void SkRecorder::drawPaint(const SkPaint& paint) { | 125 void SkRecorder::drawPaint(const SkPaint& paint) { |
| 122 APPEND(DrawPaint, delay_copy(paint)); | 126 APPEND(DrawPaint, delay_copy(paint)); |
| 123 } | 127 } |
| 124 | 128 |
| 125 void SkRecorder::drawPoints(PointMode mode, | 129 void SkRecorder::drawPoints(PointMode mode, |
| 126 size_t count, | 130 size_t count, |
| 127 const SkPoint pts[], | 131 const SkPoint pts[], |
| 128 const SkPaint& paint) { | 132 const SkPaint& paint) { |
| 129 APPEND(DrawPoints, delay_copy(paint), mode, SkToUInt(count), this->copy(pts,
count)); | 133 APPEND(DrawPoints, delay_copy(paint), mode, SkToUInt(count), this->copy(pts,
count)); |
| 130 } | 134 } |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 APPEND(EndCommentGroup); | 361 APPEND(EndCommentGroup); |
| 358 } | 362 } |
| 359 | 363 |
| 360 bool SkRecorder::isDrawingToLayer() const { | 364 bool SkRecorder::isDrawingToLayer() const { |
| 361 return fSaveLayerCount > 0; | 365 return fSaveLayerCount > 0; |
| 362 } | 366 } |
| 363 | 367 |
| 364 void SkRecorder::drawData(const void* data, size_t length) { | 368 void SkRecorder::drawData(const void* data, size_t length) { |
| 365 APPEND(DrawData, copy((const char*)data), length); | 369 APPEND(DrawData, copy((const char*)data), length); |
| 366 } | 370 } |
| OLD | NEW |