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 "SkBigPicture.h" | 8 #include "SkBigPicture.h" |
9 #include "SkCanvasPriv.h" | 9 #include "SkCanvasPriv.h" |
10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 if (fDrawPictureMode == Record_DrawPictureMode) { | 298 if (fDrawPictureMode == Record_DrawPictureMode) { |
299 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); | 299 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); |
300 APPEND(DrawPicture, this->copy(paint), pic, matrix ? *matrix : SkMatrix:
:I()); | 300 APPEND(DrawPicture, this->copy(paint), pic, matrix ? *matrix : SkMatrix:
:I()); |
301 } else { | 301 } else { |
302 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); | 302 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); |
303 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); | 303 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); |
304 pic->playback(this); | 304 pic->playback(this); |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
| 308 void SkRecorder::onDrawShadowedPicture(const SkPicture* pic, sk_sp<SkLights> lig
hts) { |
| 309 if (fDrawPictureMode == Record_DrawPictureMode) { |
| 310 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); |
| 311 APPEND(DrawShadowedPicture, nullptr, pic, lights); |
| 312 } else { |
| 313 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); |
| 314 SkAutoCanvasMatrixPaint acmp(this, nullptr, nullptr, pic->cullRect()); |
| 315 pic->playback(this); |
| 316 } |
| 317 } |
| 318 |
| 319 |
308 void SkRecorder::onDrawVertices(VertexMode vmode, | 320 void SkRecorder::onDrawVertices(VertexMode vmode, |
309 int vertexCount, const SkPoint vertices[], | 321 int vertexCount, const SkPoint vertices[], |
310 const SkPoint texs[], const SkColor colors[], | 322 const SkPoint texs[], const SkColor colors[], |
311 SkXfermode* xmode, | 323 SkXfermode* xmode, |
312 const uint16_t indices[], int indexCount, const
SkPaint& paint) { | 324 const uint16_t indices[], int indexCount, const
SkPaint& paint) { |
313 APPEND(DrawVertices, paint, | 325 APPEND(DrawVertices, paint, |
314 vmode, | 326 vmode, |
315 vertexCount, | 327 vertexCount, |
316 this->copy(vertices, vertexCount), | 328 this->copy(vertices, vertexCount), |
317 texs ? this->copy(texs, vertexCount) : nullptr, | 329 texs ? this->copy(texs, vertexCount) : nullptr, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 404 } |
393 | 405 |
394 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 406 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
395 INHERITED(onClipRegion, deviceRgn, op); | 407 INHERITED(onClipRegion, deviceRgn, op); |
396 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); | 408 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); |
397 } | 409 } |
398 | 410 |
399 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { | 411 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { |
400 return nullptr; | 412 return nullptr; |
401 } | 413 } |
OLD | NEW |