diff options
author | vjiaoblack <vjiaoblack@google.com> | 2016-07-21 09:10:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-21 09:10:23 -0700 |
commit | 0ae097d116f4332be02a135ffc99c162473dee6a (patch) | |
tree | c70d5f33b9753ec7db643eeb4de6cabb927e7ed8 /src/core/SkRecordDraw.cpp | |
parent | d2b6d6486ed9d00df779f6b337d756c9a818006f (diff) |
Creating framework for drawShadowedPicture
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003
Review-Url: https://codereview.chromium.org/2146073003
Diffstat (limited to 'src/core/SkRecordDraw.cpp')
-rw-r--r-- | src/core/SkRecordDraw.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp index 02d07d5005..cdfce66bf5 100644 --- a/src/core/SkRecordDraw.cpp +++ b/src/core/SkRecordDraw.cpp @@ -86,7 +86,11 @@ DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); DRAW(ClipRegion, clipRegion(r.region, r.op)); +#ifdef SK_EXPERIMENTAL_SHADOWING DRAW(TranslateZ, SkCanvas::translateZ(r.z)); +#else +template <> void Draw::draw(const TranslateZ& r) { } +#endif DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.paint)); @@ -107,6 +111,13 @@ DRAW(DrawPaint, drawPaint(r.paint)); DRAW(DrawPath, drawPath(r.path, r.paint)); DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint)); + +#ifdef SK_EXPERIMENTAL_SHADOWING +DRAW(DrawShadowedPicture, drawShadowedPicture(r.picture, &r.matrix, r.paint)); +#else +template <> void Draw::draw(const DrawShadowedPicture& r) { } +#endif + 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)); @@ -472,6 +483,12 @@ private: return this->adjustAndMap(dst, op.paint); } + Bounds bounds(const DrawShadowedPicture& op) const { + SkRect dst = op.picture->cullRect(); + op.matrix.mapRect(&dst); + return this->adjustAndMap(dst, op.paint); + } + Bounds bounds(const DrawPosText& op) const { const int N = op.paint.countText(op.text, op.byteLength); if (N == 0) { |