diff options
author | 2014-08-09 11:08:05 -0700 | |
---|---|---|
committer | 2014-08-09 11:08:05 -0700 | |
commit | d5fa1a455aad61f3e99081fe7a9b065cb3b115c6 (patch) | |
tree | 95a968d12fce2d8265c2562d22870253bfd3db37 /src | |
parent | a3efd90546e0de620a8b17e7bf9bd4ea53764529 (diff) |
add drawPicture variant that takes a matrix and paint
will need some staging strategy, since chrome and blink have overrides of onDrawPicture
R=robertphillips@google.com, fmalita@google.com, bsalomon@google.com, mtklein@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/448793004
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkBBoxRecord.cpp | 15 | ||||
-rw-r--r-- | src/core/SkBBoxRecord.h | 2 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 45 | ||||
-rw-r--r-- | src/core/SkCanvasPriv.h | 23 | ||||
-rw-r--r-- | src/core/SkDevice.cpp | 3 | ||||
-rw-r--r-- | src/core/SkPictureFlat.h | 3 | ||||
-rw-r--r-- | src/core/SkPicturePlayback.cpp | 7 | ||||
-rw-r--r-- | src/core/SkPictureRecord.cpp | 18 | ||||
-rw-r--r-- | src/core/SkPictureRecord.h | 2 | ||||
-rw-r--r-- | src/core/SkRecordDraw.cpp | 2 | ||||
-rw-r--r-- | src/core/SkRecorder.cpp | 4 | ||||
-rw-r--r-- | src/core/SkRecorder.h | 2 | ||||
-rw-r--r-- | src/core/SkRecords.h | 11 | ||||
-rw-r--r-- | src/gpu/GrPictureUtils.cpp | 6 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 8 | ||||
-rw-r--r-- | src/pipe/SkGPipeWrite.cpp | 11 | ||||
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 5 | ||||
-rw-r--r-- | src/utils/SkDumpCanvas.cpp | 5 | ||||
-rw-r--r-- | src/utils/SkLuaCanvas.cpp | 5 | ||||
-rw-r--r-- | src/utils/SkNWayCanvas.cpp | 5 | ||||
-rw-r--r-- | src/utils/SkProxyCanvas.cpp | 5 | ||||
-rw-r--r-- | src/utils/debugger/SkDebugCanvas.cpp | 3 | ||||
-rw-r--r-- | src/utils/debugger/SkDebugCanvas.h | 2 |
23 files changed, 149 insertions, 43 deletions
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp index 802eb669bf..96e6500888 100644 --- a/src/core/SkBBoxRecord.cpp +++ b/src/core/SkBBoxRecord.cpp @@ -293,10 +293,17 @@ void SkBBoxRecord::drawPatch(const SkPatch& patch, const SkPaint& paint) { } } -void SkBBoxRecord::onDrawPicture(const SkPicture* picture) { - if (picture->width() > 0 && picture->height() > 0 && - this->transformBounds(SkRect::MakeWH(picture->width(), picture->height()), NULL)) { - this->INHERITED::onDrawPicture(picture); +void SkBBoxRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { + SkRect bounds = SkRect::MakeWH(SkIntToScalar(picture->width()), + SkIntToScalar(picture->height())); + // todo: wonder if we should allow passing an optional matrix to transformBounds so we don't + // end up transforming the rect twice. + if (matrix) { + matrix->mapRect(&bounds); + } + if (this->transformBounds(bounds, paint)) { + this->INHERITED::onDrawPicture(picture, matrix, paint); } } diff --git a/src/core/SkBBoxRecord.h b/src/core/SkBBoxRecord.h index d10626fa50..eafd9d465e 100644 --- a/src/core/SkBBoxRecord.h +++ b/src/core/SkBBoxRecord.h @@ -67,7 +67,7 @@ protected: SkScalar constY, const SkPaint&) SK_OVERRIDE; virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkPath& path, const SkMatrix* matrix, const SkPaint&) SK_OVERRIDE; - virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE; + virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVERRIDE; virtual void willSave() SK_OVERRIDE; virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE; virtual void willRestore() SK_OVERRIDE; diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index cf7050fbeb..c6b57396e0 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -7,6 +7,7 @@ #include "SkCanvas.h" +#include "SkCanvasPriv.h" #include "SkBitmapDevice.h" #include "SkDeviceImageFilterProxy.h" #include "SkDraw.h" @@ -2397,22 +2398,32 @@ void SkCanvas::EXPERIMENTAL_optimize(const SkPicture* picture) { void SkCanvas::drawPicture(const SkPicture* picture) { if (NULL != picture) { - this->onDrawPicture(picture); + this->onDrawPicture(picture, NULL, NULL); } } -void SkCanvas::onDrawPicture(const SkPicture* picture) { - SkASSERT(NULL != picture); +void SkCanvas::drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) { + if (NULL != picture) { + if (matrix && matrix->isIdentity()) { + matrix = NULL; + } + this->onDrawPicture(picture, matrix, paint); + } +} +void SkCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { SkBaseDevice* device = this->getTopDevice(); if (NULL != device) { // Canvas has to first give the device the opportunity to render // the picture itself. - if (device->EXPERIMENTAL_drawPicture(this, picture)) { + if (device->EXPERIMENTAL_drawPicture(this, picture, matrix, paint)) { return; // the device has rendered the entire picture } } + SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->width(), picture->height()); + picture->draw(this); } @@ -2511,3 +2522,29 @@ SkCanvas* SkCanvas::NewRasterDirect(const SkImageInfo& info, void* pixels, size_ } return SkNEW_ARGS(SkCanvas, (bitmap)); } + +/////////////////////////////////////////////////////////////////////////////// + +SkAutoCanvasMatrixPaint::SkAutoCanvasMatrixPaint(SkCanvas* canvas, const SkMatrix* matrix, + const SkPaint* paint, int width, int height) + : fCanvas(canvas) + , fSaveCount(canvas->getSaveCount()) +{ + if (NULL != paint) { + SkRect bounds = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)); + if (matrix) { + matrix->mapRect(&bounds); + } + canvas->saveLayer(&bounds, paint); + } else if (NULL != matrix) { + canvas->save(); + } + + if (NULL != matrix) { + canvas->concat(*matrix); + } +} + +SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { + fCanvas->restoreToCount(fSaveCount); +} diff --git a/src/core/SkCanvasPriv.h b/src/core/SkCanvasPriv.h new file mode 100644 index 0000000000..9f66baa84e --- /dev/null +++ b/src/core/SkCanvasPriv.h @@ -0,0 +1,23 @@ +/* + * Copyright 2014 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkCanvasPriv_DEFINED +#define SkCanvasPriv_DEFINED + +#include "SkCanvas.h" + +class SkAutoCanvasMatrixPaint : SkNoncopyable { +public: + SkAutoCanvasMatrixPaint(SkCanvas*, const SkMatrix*, const SkPaint*, int width, int height); + ~SkAutoCanvasMatrixPaint(); + +private: + SkCanvas* fCanvas; + int fSaveCount; +}; + +#endif diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index e71500a962..6ceaffebb3 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -147,7 +147,8 @@ void SkBaseDevice::EXPERIMENTAL_optimize(const SkPicture* picture) { // The base class doesn't perform any analysis but derived classes may } -bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* picture) { +bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const SkMatrix*, + const SkPaint*) { // The base class doesn't perform any accelerated picture rendering return false; } diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h index 2be929b869..a8f0db4518 100644 --- a/src/core/SkPictureFlat.h +++ b/src/core/SkPictureFlat.h @@ -69,8 +69,9 @@ enum DrawType { POP_CULL, DRAW_PATCH, // could not add in aphabetical order + DRAW_PICTURE_MATRIX_PAINT, - LAST_DRAWTYPE_ENUM = DRAW_PATCH + LAST_DRAWTYPE_ENUM = DRAW_PICTURE_MATRIX_PAINT }; // In the 'match' method, this constant will match any flavor of DRAW_BITMAP* diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp index 59abe7c114..fd359fed89 100644 --- a/src/core/SkPicturePlayback.cpp +++ b/src/core/SkPicturePlayback.cpp @@ -319,6 +319,13 @@ void SkPicturePlayback::handleOp(SkReader32* reader, case DRAW_PICTURE: canvas->drawPicture(fPictureData->getPicture(reader)); break; + case DRAW_PICTURE_MATRIX_PAINT: { + const SkPicture* pic = fPictureData->getPicture(reader); + SkMatrix matrix; + reader->readMatrix(&matrix); + const SkPaint* paint = fPictureData->getPaint(reader); + canvas->drawPicture(pic, &matrix, paint); + } break; case DRAW_POINTS: { const SkPaint& paint = *fPictureData->getPaint(reader); SkCanvas::PointMode mode = (SkCanvas::PointMode)reader->readInt(); diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index 31a66abd5d..66aa46d14b 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -1387,7 +1387,8 @@ void SkPictureRecord::onDrawTextOnPath(const void* text, size_t byteLength, cons this->validate(initialOffset, size); } -void SkPictureRecord::onDrawPicture(const SkPicture* picture) { +void SkPictureRecord::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { #ifdef SK_COLLAPSE_MATRIX_CLIP_STATE fMCMgr.call(SkMatrixClipStateMgr::kOther_CallType); @@ -1395,8 +1396,19 @@ void SkPictureRecord::onDrawPicture(const SkPicture* picture) { // op + picture index size_t size = 2 * kUInt32Size; - size_t initialOffset = this->addDraw(DRAW_PICTURE, &size); - this->addPicture(picture); + size_t initialOffset; + + if (NULL == matrix && NULL == paint) { + initialOffset = this->addDraw(DRAW_PICTURE, &size); + this->addPicture(picture); + } else { + const SkMatrix& m = matrix ? *matrix : SkMatrix::I(); + size += m.writeToMemory(NULL) + kUInt32Size; // matrix + paint + initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size); + this->addPicture(picture); + this->addMatrix(m); + this->addPaintPtr(paint); + } this->validate(initialOffset, size); } diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h index 57e60086c4..21c11971c4 100644 --- a/src/core/SkPictureRecord.h +++ b/src/core/SkPictureRecord.h @@ -261,7 +261,7 @@ protected: virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; - virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE; + virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVERRIDE; // Return fontmetrics.fTop,fBottom in topbot[0,1], after they have been // tweaked by paint.computeFastBounds(). diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp index 5af00b62a1..d29e0b8c48 100644 --- a/src/core/SkRecordDraw.cpp +++ b/src/core/SkRecordDraw.cpp @@ -52,7 +52,7 @@ DRAW(DrawOval, drawOval(r.oval, r.paint)); DRAW(DrawPaint, drawPaint(r.paint)); DRAW(DrawPath, drawPath(r.path, r.paint)); DRAW(DrawPatch, drawPatch(r.patch, r.paint)); -DRAW(DrawPicture, drawPicture(r.picture)); +DRAW(DrawPicture, drawPicture(r.picture, r.matrix, r.paint)); DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp index 19d60d5bf8..6b3eac9866 100644 --- a/src/core/SkRecorder.cpp +++ b/src/core/SkRecorder.cpp @@ -186,8 +186,8 @@ void SkRecorder::onDrawTextOnPath(const void* text, size_t byteLength, const SkP this->copy(matrix)); } -void SkRecorder::onDrawPicture(const SkPicture* picture) { - APPEND(DrawPicture, picture); +void SkRecorder::onDrawPicture(const SkPicture* pic, const SkMatrix* matrix, const SkPaint* paint) { + APPEND(DrawPicture, this->copy(paint), pic, this->copy(matrix)); } void SkRecorder::drawVertices(VertexMode vmode, diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h index 437113829a..be8924846e 100644 --- a/src/core/SkRecorder.h +++ b/src/core/SkRecorder.h @@ -95,7 +95,7 @@ public: void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) SK_OVERRIDE; void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) SK_OVERRIDE; - void onDrawPicture(const SkPicture* picture) SK_OVERRIDE; + void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVERRIDE; void onPushCull(const SkRect& cullRect) SK_OVERRIDE; void onPopCull() SK_OVERRIDE; diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h index 347bc36276..6aefd195c9 100644 --- a/src/core/SkRecords.h +++ b/src/core/SkRecords.h @@ -14,17 +14,14 @@ class SkPictureBox { public: SkPictureBox(const SkPicture* obj) : fObj(SkRef(obj)) {} - SkPictureBox(const SkPictureBox& src) : fObj(SkRef(src.fObj)) {} ~SkPictureBox() { fObj->unref(); } - SkPictureBox& operator=(const SkPictureBox& src) { - SkRefCnt_SafeAssign(fObj, src.fObj); - return *this; - } - operator const SkPicture*() const { return fObj; } private: + SkPictureBox(const SkPictureBox&); + SkPictureBox& operator=(const SkPictureBox&); + const SkPicture* fObj; }; @@ -236,7 +233,7 @@ RECORD2(DrawOval, SkPaint, paint, SkRect, oval); RECORD1(DrawPaint, SkPaint, paint); RECORD2(DrawPath, SkPaint, paint, SkPath, path); RECORD2(DrawPatch, SkPaint, paint, SkPatch, patch); -RECORD1(DrawPicture, SkPictureBox, picture); +RECORD3(DrawPicture, Optional<SkPaint>, paint, SkPictureBox, picture, Optional<SkMatrix>, matrix); RECORD4(DrawPoints, SkPaint, paint, SkCanvas::PointMode, mode, size_t, count, SkPoint*, pts); RECORD4(DrawPosText, SkPaint, paint, PODArray<char>, text, diff --git a/src/gpu/GrPictureUtils.cpp b/src/gpu/GrPictureUtils.cpp index 0bcd927e57..6e3c6b7ef6 100644 --- a/src/gpu/GrPictureUtils.cpp +++ b/src/gpu/GrPictureUtils.cpp @@ -6,6 +6,7 @@ */ #include "GrPictureUtils.h" +#include "SkCanvasPriv.h" #include "SkDevice.h" #include "SkDraw.h" #include "SkPaintPriv.h" @@ -234,7 +235,10 @@ protected: this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false); } - virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE { + virtual void onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) SK_OVERRIDE { + SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->width(), picture->height()); + if (NULL != picture->fData.get()) { // Disable the BBH for the old path so all the draw calls // will be seen. The stock SkPicture::draw method can't be diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 3ba2abcc85..3e6bf1b6e4 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1872,7 +1872,13 @@ static void wrap_texture(GrTexture* texture, int width, int height, SkBitmap* re result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); } -bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture* picture) { +bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture* picture, + const SkMatrix* matrix, const SkPaint* paint) { + // todo: should handle these natively + if (matrix || paint) { + return false; + } + fContext->getLayerCache()->processDeletedPictures(); SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp index 186b66cd98..d796e8a99b 100644 --- a/src/pipe/SkGPipeWrite.cpp +++ b/src/pipe/SkGPipeWrite.cpp @@ -289,7 +289,7 @@ protected: virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; - virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE; + virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVERRIDE; private: void recordTranslate(const SkMatrix&); @@ -933,9 +933,14 @@ void SkGPipeCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const } } -void SkGPipeCanvas::onDrawPicture(const SkPicture* picture) { +void SkGPipeCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { // we want to playback the picture into individual draw calls - this->INHERITED::onDrawPicture(picture); + // + // todo: do we always have to unroll? If the pipe is not cross-process, seems like + // we could just ref the picture and move on...? <reed, scroggo> + // + this->INHERITED::onDrawPicture(picture, matrix, paint); } void SkGPipeCanvas::drawVertices(VertexMode vmode, int vertexCount, diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 17a1f6c461..128f8a564d 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -899,8 +899,9 @@ void SkDeferredCanvas::onDrawTextOnPath(const void* text, size_t byteLength, con this->recordedDrawCommand(); } -void SkDeferredCanvas::onDrawPicture(const SkPicture* picture) { - this->drawingCanvas()->drawPicture(picture); +void SkDeferredCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { + this->drawingCanvas()->drawPicture(picture, matrix, paint); this->recordedDrawCommand(); } diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index 3c683e67c5..946aaa33be 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -422,11 +422,12 @@ void SkDumpCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const S str.c_str(), byteLength); } -void SkDumpCanvas::onDrawPicture(const SkPicture* picture) { +void SkDumpCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { this->dump(kDrawPicture_Verb, NULL, "drawPicture(%p) %d:%d", picture, picture->width(), picture->height()); fNestLevel += 1; - this->INHERITED::onDrawPicture(picture); + this->INHERITED::onDrawPicture(picture, matrix, paint); fNestLevel -= 1; this->dump(kDrawPicture_Verb, NULL, "endPicture(%p) %d:%d", &picture, picture->width(), picture->height()); diff --git a/src/utils/SkLuaCanvas.cpp b/src/utils/SkLuaCanvas.cpp index b0b912827f..0903ee8c89 100644 --- a/src/utils/SkLuaCanvas.cpp +++ b/src/utils/SkLuaCanvas.cpp @@ -268,10 +268,11 @@ void SkLuaCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const Sk lua.pushPaint(paint, "paint"); } -void SkLuaCanvas::onDrawPicture(const SkPicture* picture) { +void SkLuaCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { AUTO_LUA("drawPicture"); // call through so we can see the nested picture ops - this->INHERITED::onDrawPicture(picture); + this->INHERITED::onDrawPicture(picture, matrix, paint); } void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount, diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp index b33c99ea4f..d02835af65 100644 --- a/src/utils/SkNWayCanvas.cpp +++ b/src/utils/SkNWayCanvas.cpp @@ -265,10 +265,11 @@ void SkNWayCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const S } } -void SkNWayCanvas::onDrawPicture(const SkPicture* picture) { +void SkNWayCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { Iter iter(fList); while (iter.next()) { - iter->drawPicture(picture); + iter->drawPicture(picture, matrix, paint); } } diff --git a/src/utils/SkProxyCanvas.cpp b/src/utils/SkProxyCanvas.cpp index 1029f4005f..773fd201ab 100644 --- a/src/utils/SkProxyCanvas.cpp +++ b/src/utils/SkProxyCanvas.cpp @@ -136,8 +136,9 @@ void SkProxyCanvas::onDrawTextOnPath(const void* text, size_t byteLength, const fProxy->drawTextOnPath(text, byteLength, path, matrix, paint); } -void SkProxyCanvas::onDrawPicture(const SkPicture* picture) { - fProxy->drawPicture(picture); +void SkProxyCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix* matrix, + const SkPaint* paint) { + fProxy->drawPicture(picture, matrix, paint); } void SkProxyCanvas::drawVertices(VertexMode vmode, int vertexCount, diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp index 277e86d84d..516d58292f 100644 --- a/src/utils/debugger/SkDebugCanvas.cpp +++ b/src/utils/debugger/SkDebugCanvas.cpp @@ -519,7 +519,8 @@ void SkDebugCanvas::drawPath(const SkPath& path, const SkPaint& paint) { this->addDrawCommand(new SkDrawPathCommand(path, paint)); } -void SkDebugCanvas::onDrawPicture(const SkPicture* picture) { +void SkDebugCanvas::onDrawPicture(const SkPicture* picture, const SkMatrix*, const SkPaint*) { + // todo: add matrix and paint to SkDrawPictureCommand this->addDrawCommand(new SkDrawPictureCommand(picture)); } diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h index 50a9152239..e774121cb9 100644 --- a/src/utils/debugger/SkDebugCanvas.h +++ b/src/utils/debugger/SkDebugCanvas.h @@ -255,7 +255,7 @@ protected: virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE; virtual void onClipRegion(const SkRegion& region, SkRegion::Op) SK_OVERRIDE; - virtual void onDrawPicture(const SkPicture* picture) SK_OVERRIDE; + virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) SK_OVERRIDE; void markActiveCommands(int index); |