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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 APPEND(DrawBitmapMatrix, this->copy(paint), delay_copy(bitmap), matrix); | 148 APPEND(DrawBitmapMatrix, this->copy(paint), delay_copy(bitmap), matrix); |
149 } | 149 } |
150 | 150 |
151 void SkRecorder::drawBitmapNine(const SkBitmap& bitmap, | 151 void SkRecorder::drawBitmapNine(const SkBitmap& bitmap, |
152 const SkIRect& center, | 152 const SkIRect& center, |
153 const SkRect& dst, | 153 const SkRect& dst, |
154 const SkPaint* paint) { | 154 const SkPaint* paint) { |
155 APPEND(DrawBitmapNine, this->copy(paint), delay_copy(bitmap), center, dst); | 155 APPEND(DrawBitmapNine, this->copy(paint), delay_copy(bitmap), center, dst); |
156 } | 156 } |
157 | 157 |
| 158 void SkRecorder::drawImage(const SkImage* image, SkScalar left, SkScalar top, |
| 159 const SkPaint* paint) { |
| 160 APPEND(DrawImage, this->copy(paint), image, left, top); |
| 161 } |
| 162 |
| 163 void SkRecorder::drawImageRect(const SkImage* image, const SkRect* src, |
| 164 const SkRect& dst, |
| 165 const SkPaint* paint) { |
| 166 APPEND(DrawImageRect, this->copy(paint), image, this->copy(src), dst); |
| 167 } |
| 168 |
158 void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkP
aint* paint) { | 169 void SkRecorder::drawSprite(const SkBitmap& bitmap, int left, int top, const SkP
aint* paint) { |
159 APPEND(DrawSprite, this->copy(paint), delay_copy(bitmap), left, top); | 170 APPEND(DrawSprite, this->copy(paint), delay_copy(bitmap), left, top); |
160 } | 171 } |
161 | 172 |
162 void SkRecorder::onDrawText(const void* text, size_t byteLength, | 173 void SkRecorder::onDrawText(const void* text, size_t byteLength, |
163 SkScalar x, SkScalar y, const SkPaint& paint) { | 174 SkScalar x, SkScalar y, const SkPaint& paint) { |
164 APPEND(DrawText, | 175 APPEND(DrawText, |
165 delay_copy(paint), this->copy((const char*)text, byteLength), byteLen
gth, x, y); | 176 delay_copy(paint), this->copy((const char*)text, byteLength), byteLen
gth, x, y); |
166 } | 177 } |
167 | 178 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 APPEND(EndCommentGroup); | 317 APPEND(EndCommentGroup); |
307 } | 318 } |
308 | 319 |
309 bool SkRecorder::isDrawingToLayer() const { | 320 bool SkRecorder::isDrawingToLayer() const { |
310 return fSaveLayerCount > 0; | 321 return fSaveLayerCount > 0; |
311 } | 322 } |
312 | 323 |
313 void SkRecorder::drawData(const void* data, size_t length) { | 324 void SkRecorder::drawData(const void* data, size_t length) { |
314 APPEND(DrawData, copy((const char*)data), length); | 325 APPEND(DrawData, copy((const char*)data), length); |
315 } | 326 } |
OLD | NEW |