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 | |
125 void SkRecorder::drawPaint(const SkPaint& paint) { | 121 void SkRecorder::drawPaint(const SkPaint& paint) { |
126 APPEND(DrawPaint, delay_copy(paint)); | 122 APPEND(DrawPaint, delay_copy(paint)); |
127 } | 123 } |
128 | 124 |
129 void SkRecorder::drawPoints(PointMode mode, | 125 void SkRecorder::drawPoints(PointMode mode, |
130 size_t count, | 126 size_t count, |
131 const SkPoint pts[], | 127 const SkPoint pts[], |
132 const SkPaint& paint) { | 128 const SkPaint& paint) { |
133 APPEND(DrawPoints, delay_copy(paint), mode, SkToUInt(count), this->copy(pts,
count)); | 129 APPEND(DrawPoints, delay_copy(paint), mode, SkToUInt(count), this->copy(pts,
count)); |
134 } | 130 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 APPEND(EndCommentGroup); | 357 APPEND(EndCommentGroup); |
362 } | 358 } |
363 | 359 |
364 bool SkRecorder::isDrawingToLayer() const { | 360 bool SkRecorder::isDrawingToLayer() const { |
365 return fSaveLayerCount > 0; | 361 return fSaveLayerCount > 0; |
366 } | 362 } |
367 | 363 |
368 void SkRecorder::drawData(const void* data, size_t length) { | 364 void SkRecorder::drawData(const void* data, size_t length) { |
369 APPEND(DrawData, copy((const char*)data), length); | 365 APPEND(DrawData, copy((const char*)data), length); |
370 } | 366 } |
OLD | NEW |