| 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 "SkImage.h" | 10 #include "SkImage.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 if (fDrawPictureMode == Record_DrawPictureMode) { | 288 if (fDrawPictureMode == Record_DrawPictureMode) { |
| 289 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); | 289 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); |
| 290 APPEND(DrawPicture, this->copy(paint), sk_ref_sp(pic), matrix ? *matrix
: SkMatrix::I()); | 290 APPEND(DrawPicture, this->copy(paint), sk_ref_sp(pic), matrix ? *matrix
: SkMatrix::I()); |
| 291 } else { | 291 } else { |
| 292 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); | 292 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); |
| 293 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); | 293 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); |
| 294 pic->playback(this); | 294 pic->playback(this); |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 | 297 |
| 298 void SkRecorder::onDrawShadowedPicture(const SkPicture* pic, | 298 void SkRecorder::onDrawShadowedPicture(const SkPicture* pic, const SkMatrix* mat
rix, |
| 299 const SkMatrix* matrix, | 299 const SkPaint* paint, const SkShadowParam
s& sParams) { |
| 300 const SkPaint* paint) { | |
| 301 if (fDrawPictureMode == Record_DrawPictureMode) { | 300 if (fDrawPictureMode == Record_DrawPictureMode) { |
| 302 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); | 301 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); |
| 303 APPEND(DrawShadowedPicture, this->copy(paint), | 302 APPEND(DrawShadowedPicture, this->copy(paint), |
| 304 sk_ref_sp(pic), | 303 sk_ref_sp(pic), |
| 305 matrix ? *matrix : SkMatrix::I()); | 304 matrix ? *matrix : SkMatrix::I(), |
| 305 sParams); |
| 306 } else { | 306 } else { |
| 307 // TODO update pic->playback(this) to draw the shadowed pic |
| 307 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); | 308 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); |
| 308 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); | 309 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); |
| 309 pic->playback(this); | 310 pic->playback(this); |
| 310 } | 311 } |
| 311 } | 312 } |
| 312 | 313 |
| 313 | 314 |
| 314 void SkRecorder::onDrawVertices(VertexMode vmode, | 315 void SkRecorder::onDrawVertices(VertexMode vmode, |
| 315 int vertexCount, const SkPoint vertices[], | 316 int vertexCount, const SkPoint vertices[], |
| 316 const SkPoint texs[], const SkColor colors[], | 317 const SkPoint texs[], const SkColor colors[], |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 } | 403 } |
| 403 | 404 |
| 404 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 405 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
| 405 INHERITED(onClipRegion, deviceRgn, op); | 406 INHERITED(onClipRegion, deviceRgn, op); |
| 406 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); | 407 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); |
| 407 } | 408 } |
| 408 | 409 |
| 409 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { | 410 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { |
| 410 return nullptr; | 411 return nullptr; |
| 411 } | 412 } |
| OLD | NEW |