| 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 "SkPicture.h" | 9 #include "SkPicture.h" |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 const SkIRect& center, | 138 const SkIRect& center, |
| 139 const SkRect& dst, | 139 const SkRect& dst, |
| 140 const SkPaint* paint) { | 140 const SkPaint* paint) { |
| 141 APPEND(DrawBitmapNine, delay_copy(bitmap), center, dst, this->copy(paint)); | 141 APPEND(DrawBitmapNine, delay_copy(bitmap), center, dst, this->copy(paint)); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkP
aint* paint) { | 144 void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkP
aint* paint) { |
| 145 APPEND(DrawSprite, delay_copy(bitmap), left, top, this->copy(paint)); | 145 APPEND(DrawSprite, delay_copy(bitmap), left, top, this->copy(paint)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void SkRecorder::onDrawText(const void* text, size_t byteLength, | 148 void SkRecorder::drawText(const void* text, size_t byteLength, |
| 149 SkScalar x, SkScalar y, const SkPaint& paint) { | 149 SkScalar x, SkScalar y, const SkPaint& paint) { |
| 150 APPEND(DrawText, | 150 APPEND(DrawText, |
| 151 this->copy((const char*)text, byteLength), byteLength, x, y, delay_co
py(paint)); | 151 this->copy((const char*)text, byteLength), byteLength, x, y, delay_co
py(paint)); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void SkRecorder::onDrawPosText(const void* text, size_t byteLength, | 154 void SkRecorder::drawPosText(const void* text, size_t byteLength, |
| 155 const SkPoint pos[], const SkPaint& paint) { | 155 const SkPoint pos[], const SkPaint& paint) { |
| 156 const unsigned points = paint.countText(text, byteLength); | 156 const unsigned points = paint.countText(text, byteLength); |
| 157 APPEND(DrawPosText, | 157 APPEND(DrawPosText, |
| 158 this->copy((const char*)text, byteLength), byteLength, | 158 this->copy((const char*)text, byteLength), byteLength, |
| 159 this->copy(pos, points), delay_copy(paint)); | 159 this->copy(pos, points), delay_copy(paint)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void SkRecorder::onDrawPosTextH(const void* text, size_t byteLength, | 162 void SkRecorder::drawPosTextH(const void* text, size_t byteLength, |
| 163 const SkScalar xpos[], SkScalar constY, const Sk
Paint& paint) { | 163 const SkScalar xpos[], SkScalar constY, const SkPa
int& paint) { |
| 164 const unsigned points = paint.countText(text, byteLength); | 164 const unsigned points = paint.countText(text, byteLength); |
| 165 APPEND(DrawPosTextH, | 165 APPEND(DrawPosTextH, |
| 166 this->copy((const char*)text, byteLength), byteLength, | 166 this->copy((const char*)text, byteLength), byteLength, |
| 167 this->copy(xpos, points), constY, delay_copy(paint)); | 167 this->copy(xpos, points), constY, delay_copy(paint)); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void SkRecorder::onDrawTextOnPath(const void* text, size_t byteLength, const SkP
ath& path, | 170 void SkRecorder::drawTextOnPath(const void* text, size_t byteLength, |
| 171 const SkMatrix* matrix, const SkPaint& paint)
{ | 171 const SkPath& path, const SkMatrix* matrix, cons
t SkPaint& paint) { |
| 172 APPEND(DrawTextOnPath, | 172 APPEND(DrawTextOnPath, |
| 173 this->copy((const char*)text, byteLength), byteLength, | 173 this->copy((const char*)text, byteLength), byteLength, |
| 174 delay_copy(path), this->copy(matrix), delay_copy(paint)); | 174 delay_copy(path), this->copy(matrix), delay_copy(paint)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void SkRecorder::drawPicture(SkPicture& picture) { | 177 void SkRecorder::drawPicture(SkPicture& picture) { |
| 178 picture.draw(this); | 178 picture.draw(this); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void SkRecorder::drawVertices(VertexMode vmode, | 181 void SkRecorder::drawVertices(VertexMode vmode, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { | 243 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e
dgeStyle) { |
| 244 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); | 244 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); |
| 245 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is
InverseFillType()); | 245 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is
InverseFillType()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 248 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
| 249 APPEND(ClipRegion, delay_copy(deviceRgn), op); | 249 APPEND(ClipRegion, delay_copy(deviceRgn), op); |
| 250 INHERITED(onClipRegion, deviceRgn, op); | 250 INHERITED(onClipRegion, deviceRgn, op); |
| 251 } | 251 } |
| OLD | NEW |