| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 if (fDrawPictureMode == Record_DrawPictureMode) { | 296 if (fDrawPictureMode == Record_DrawPictureMode) { |
| 297 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); | 297 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); |
| 298 APPEND(DrawPicture, this->copy(paint), sk_ref_sp(pic), matrix ? *matrix
: SkMatrix::I()); | 298 APPEND(DrawPicture, this->copy(paint), sk_ref_sp(pic), matrix ? *matrix
: SkMatrix::I()); |
| 299 } else { | 299 } else { |
| 300 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); | 300 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); |
| 301 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); | 301 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); |
| 302 pic->playback(this); | 302 pic->playback(this); |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 | 305 |
| 306 void SkRecorder::onDrawShadowedPicture(const SkPicture* pic, | 306 void SkRecorder::onDrawShadowedPicture(const SkPicture* pic, const SkMatrix* mat
rix, |
| 307 const SkMatrix* matrix, | 307 const SkPaint* paint, const SkShadowParam
s& params) { |
| 308 const SkPaint* paint) { | |
| 309 if (fDrawPictureMode == Record_DrawPictureMode) { | 308 if (fDrawPictureMode == Record_DrawPictureMode) { |
| 310 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); | 309 fApproxBytesUsedBySubPictures += SkPictureUtils::ApproximateBytesUsed(pi
c); |
| 311 APPEND(DrawShadowedPicture, this->copy(paint), | 310 APPEND(DrawShadowedPicture, this->copy(paint), |
| 312 sk_ref_sp(pic), | 311 sk_ref_sp(pic), |
| 313 matrix ? *matrix : SkMatrix::I()); | 312 matrix ? *matrix : SkMatrix::I(), |
| 313 params); |
| 314 } else { | 314 } else { |
| 315 // TODO update pic->playback(this) to draw the shadowed pic |
| 315 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); | 316 SkASSERT(fDrawPictureMode == Playback_DrawPictureMode); |
| 316 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); | 317 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, pic->cullRect()); |
| 317 pic->playback(this); | 318 pic->playback(this); |
| 318 } | 319 } |
| 319 } | 320 } |
| 320 | 321 |
| 321 | 322 |
| 322 void SkRecorder::onDrawVertices(VertexMode vmode, | 323 void SkRecorder::onDrawVertices(VertexMode vmode, |
| 323 int vertexCount, const SkPoint vertices[], | 324 int vertexCount, const SkPoint vertices[], |
| 324 const SkPoint texs[], const SkColor colors[], | 325 const SkPoint texs[], const SkColor colors[], |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 } | 415 } |
| 415 | 416 |
| 416 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { | 417 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { |
| 417 INHERITED(onClipRegion, deviceRgn, op); | 418 INHERITED(onClipRegion, deviceRgn, op); |
| 418 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); | 419 APPEND(ClipRegion, this->devBounds(), deviceRgn, op); |
| 419 } | 420 } |
| 420 | 421 |
| 421 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { | 422 sk_sp<SkSurface> SkRecorder::onNewSurface(const SkImageInfo&, const SkSurfacePro
ps&) { |
| 422 return nullptr; | 423 return nullptr; |
| 423 } | 424 } |
| OLD | NEW |